Changeset 1652 for pjproject/trunk


Ignore:
Timestamp:
Jan 2, 2008 8:21:43 AM (17 years ago)
Author:
bennylp
Message:

Defect: new allocator didn't call factory on_block_alloc()/on_block_free()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/pool_policy_new.cpp

    r1405 r1652  
    3434 
    3535    PJ_CHECK_STACK(); 
    36     PJ_UNUSED_ARG(factory); 
    37     PJ_UNUSED_ARG(size); 
    3836 
     37    if (factory->on_block_alloc) { 
     38                int rc; 
     39                rc = factory->on_block_alloc(factory, size); 
     40                if (!rc) 
     41                    return NULL; 
     42    } 
     43     
    3944    mem = (void*) new char[size+(SIG_SIZE << 1)]; 
    4045     
     
    5358{ 
    5459    PJ_CHECK_STACK(); 
    55     PJ_UNUSED_ARG(factory); 
    56     PJ_UNUSED_ARG(size); 
    5760 
     61    if (factory->on_block_free)  
     62        factory->on_block_free(factory, size); 
     63     
    5864    /* Check and remove signature when PJ_SAFE_POOL is set. It will 
    5965     * move "mem" pointer backward. 
Note: See TracChangeset for help on using the changeset viewer.