Changeset 416 for trunk/libs/malloc.c


Ignore:
Timestamp:
Jan 4, 2018, 10:05:47 AM (4 years ago)
Author:
alain
Message:

Improve sys_exec.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/malloc.c

    r412 r416  
    107107// It uses the mmap( MAP_REMOTE ) syscall to allocate a new vseg mapped in cluster (cxy).
    108108////////////////////////////////////////////////////////////////////i//////////////////////
    109 // @ cxy       : target cluster identifier (fixed format).
    110 // @ size      : store size (bytes).
     109// @ cxy        : target cluster identifier (fixed format).
     110// @ store_size : store size (bytes).
    111111// # return without setting the initialized field in store(cxy) if failure.
    112112////////////////////////////////////////////////////////////////////i//////////////////////
     
    185185    }
    186186
    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]
    188190    // memset( (void *)alloc_base , 0 , alloc_size );
    189191 
     
    216218    store[cxy].initialized = MALLOC_INITIALIZED;
    217219
     220
    218221#if MALLOC_DEBUG
    219 printf("\n[MALLOC] %s completes store[%x] initialisation\n",
     222printf("\n[MALLOC] %s : completes store[%x] initialisation\n",
    220223__FUNCTION__, cxy );
     224
     225display_free_array( cxy );
    221226#endif
    222227
     
    344349    unsigned char * ptr    = (unsigned char*)(store[cxy].alloc_base + offset);
    345350
    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    // }
    354361
    355362    // update alloc_array
Note: See TracChangeset for help on using the changeset viewer.