Changeset 416 for trunk/libs/malloc.c
- Timestamp:
- Jan 4, 2018, 10:05:47 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/malloc.c
r412 r416 107 107 // It uses the mmap( MAP_REMOTE ) syscall to allocate a new vseg mapped in cluster (cxy). 108 108 ////////////////////////////////////////////////////////////////////i////////////////////// 109 // @ cxy : target cluster identifier (fixed format).110 // @ s ize: store size (bytes).109 // @ cxy : target cluster identifier (fixed format). 110 // @ store_size : store size (bytes). 111 111 // # return without setting the initialized field in store(cxy) if failure. 112 112 ////////////////////////////////////////////////////////////////////i////////////////////// … … 185 185 } 186 186 187 // reset the alloc_size array 187 // DEPRECATED: we don't reset the alloc_size array 188 // because we don't want to allocate the physical memory 189 // when the heap is created [AG] 188 190 // memset( (void *)alloc_base , 0 , alloc_size ); 189 191 … … 216 218 store[cxy].initialized = MALLOC_INITIALIZED; 217 219 220 218 221 #if MALLOC_DEBUG 219 printf("\n[MALLOC] %s completes store[%x] initialisation\n",222 printf("\n[MALLOC] %s : completes store[%x] initialisation\n", 220 223 __FUNCTION__, cxy ); 224 225 display_free_array( cxy ); 221 226 #endif 222 227 … … 344 349 unsigned char * ptr = (unsigned char*)(store[cxy].alloc_base + offset); 345 350 346 // check the alloc[] array 347 if ( *ptr != 0 ) 348 { 349 pthread_mutex_unlock( &store[cxy].mutex ); 350 printf("\n[PANIC] in %s : allocate an already allocated block...\n", 351 __FUNCTION__ ); 352 return NULL; 353 } 351 // DEPRECATED : we don't check the alloc[] array, 352 // because it has not been initialised, to avoid 353 // physical memory allocation at heap creation [AG] 354 // if ( *ptr != 0 ) 355 // { 356 // pthread_mutex_unlock( &store[cxy].mutex ); 357 // printf("\n[PANIC] in %s : allocate an already allocated block...\n", 358 // __FUNCTION__ ); 359 // return NULL; 360 // } 354 361 355 362 // update alloc_array
Note: See TracChangeset
for help on using the changeset viewer.