Ignore:
Timestamp:
Oct 5, 2018, 12:21:52 AM (3 years ago)
Author:
alain
Message:

Cosmetic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/libalmosmkh/almosmkh.c

    r478 r573  
    3232#include <mman.h>
    3333
     34#define  MALLOC_DEBUG    0
     35 
    3436/////////////     Non standard system calls    /////////////////////////////////
    3537
     
    216218}
    217219
    218 /////////////////
     220///////////////////////
    219221int display_vfs( void )
    220222{
     
    231233}
    232234
    233 //////////////////////////////////
     235///////////////////////////////
    234236int trace( unsigned int active,
    235237           unsigned int cxy,
     
    242244}
    243245
    244 //////////////////
     246////////////////////////
    245247int display_dqdt( void )
    246248{
     
    249251}
    250252
    251 ///////////
     253/////////////////
    252254void idbg( void )
    253255{
     
    327329///////////////    non standard malloc functions    //////////////////////////
    328330
    329 #define  MALLOC_DEBUG  0
    330  
    331331/////////////////////////////////////////////////////////////////////////////////////////
    332332// Global variable defining the allocator array (one per cluster)
     
    377377////////////////////////////////////////////////////////////////////////////////////////////
    378378
    379 #if 0
     379#if MALLOC_DEBUG
    380380static void display_free_array( unsigned int cxy )
    381381{
     
    487487    }
    488488
    489     // DEPRECATED: we don't reset the alloc_size array
     489    // DEPRECATED: we don't reset the alloc_base array
    490490    // because we don't want to allocate the physical memory
    491491    // when the heap is created  [AG]
     
    591591                      unsigned int cxy )
    592592{
     593    int error;
    593594
    594595#if MALLOC_DEBUG
     
    631632
    632633    // 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    }
    634642
    635643    // call the recursive function get_block
     
    651659    unsigned char * ptr    = (unsigned char*)(store[cxy].alloc_base + offset);
    652660
    653     // DEPRECATED : we don't check the alloc[] array,
    654     // because it has not been initialised, to avoid
    655     // 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]
    656664    // if ( *ptr != 0 )
    657665    // {
Note: See TracChangeset for help on using the changeset viewer.