Changeset 573 for trunk/libs/libalmosmkh
- Timestamp:
- Oct 5, 2018, 12:21:52 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/libalmosmkh/almosmkh.c
r478 r573 32 32 #include <mman.h> 33 33 34 #define MALLOC_DEBUG 0 35 34 36 ///////////// Non standard system calls ///////////////////////////////// 35 37 … … 216 218 } 217 219 218 ///////////////// 220 /////////////////////// 219 221 int display_vfs( void ) 220 222 { … … 231 233 } 232 234 233 /////////////////////////////// ///235 /////////////////////////////// 234 236 int trace( unsigned int active, 235 237 unsigned int cxy, … … 242 244 } 243 245 244 ////////////////// 246 //////////////////////// 245 247 int display_dqdt( void ) 246 248 { … … 249 251 } 250 252 251 /////////// 253 ///////////////// 252 254 void idbg( void ) 253 255 { … … 327 329 /////////////// non standard malloc functions ////////////////////////// 328 330 329 #define MALLOC_DEBUG 0330 331 331 ///////////////////////////////////////////////////////////////////////////////////////// 332 332 // Global variable defining the allocator array (one per cluster) … … 377 377 //////////////////////////////////////////////////////////////////////////////////////////// 378 378 379 #if 0379 #if MALLOC_DEBUG 380 380 static void display_free_array( unsigned int cxy ) 381 381 { … … 487 487 } 488 488 489 // DEPRECATED: we don't reset the alloc_ size array489 // DEPRECATED: we don't reset the alloc_base array 490 490 // because we don't want to allocate the physical memory 491 491 // when the heap is created [AG] … … 591 591 unsigned int cxy ) 592 592 { 593 int error; 593 594 594 595 #if MALLOC_DEBUG … … 631 632 632 633 // take the lock protecting access to store[cxy] 633 pthread_mutex_lock( &store[cxy].mutex ); 634 error = pthread_mutex_lock( &store[cxy].mutex ); 635 636 if( error ) 637 { 638 printf("\n[ERROR] in %s : cannot take the lock protecting store in cluster %x\n", 639 __FUNCTION__ , cxy ); 640 return NULL; 641 } 634 642 635 643 // call the recursive function get_block … … 651 659 unsigned char * ptr = (unsigned char*)(store[cxy].alloc_base + offset); 652 660 653 // DEPRECATED : we don't check the alloc[] array,654 // because it has not been initialised , to avoid655 // physical memory allocation at heap creation [AG]661 // DEPRECATED : we cannot check the alloc[] array, 662 // because it has not been initialised by store_init, 663 // to avoid physical memory allocation at heap creation [AG] 656 664 // if ( *ptr != 0 ) 657 665 // {
Note: See TracChangeset
for help on using the changeset viewer.