Changeset 74214f8 in git


Ignore:
Timestamp:
2013-09-23T09:51:43Z (6 years ago)
Author:
Xuefer <xuefer@…>
Branches:
3.1, 3.2, master, trunk
Children:
0f9c2da
Parents:
f703531
Message:

calc avail for test

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1392 c26eb9a1-5813-0410-bd6c-c2e55f420ca7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • xcache/xc_malloc.c

    rf703531 r74214f8  
    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.