Changeset 1392 in svn for trunk


Ignore:
Timestamp:
2013-09-23T11:51:43+02:00 (22 months ago)
Author:
Xuefer
Message:

calc avail for test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache/xc_malloc.c

    r1391 r1392  
    3939{
    4040    if (p) {
    41 #ifdef TEST
    4241        allocator->avail -= size;
    43 #else
     42#ifndef TEST
    4443        zend_hash_add(&allocator->shm->blocks, (void *) &p, sizeof(p), (void *) &size, sizeof(size), NULL);
    4544#endif
     
    6059static XC_ALLOCATOR_MALLOC(xc_allocator_malloc_malloc) /* {{{ */
    6160{
     61    if (allocator->avail < size) {
     62        return NULL;
     63    }
    6264    return xc_add_to_blocks(allocator, malloc(size), size);
    6365}
     
    7274static XC_ALLOCATOR_CALLOC(xc_allocator_malloc_calloc) /* {{{ */
    7375{
     76    if (allocator->avail < size) {
     77        return NULL;
     78    }
    7479    return xc_add_to_blocks(allocator, calloc(memb, size), size);
    7580}
Note: See TracChangeset for help on using the changeset viewer.