Changeset 1333 for pjproject/trunk/pjlib/src/pj/pool_policy_malloc.c
- Timestamp:
- Jun 1, 2007 7:26:21 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/pool_policy_malloc.c
r974 r1333 27 27 * This file contains pool default policy definition and implementation. 28 28 */ 29 #include "pool_signature.h" 29 30 30 31 … … 42 43 } 43 44 44 p = malloc(size );45 p = malloc(size+(SIG_SIZE << 1)); 45 46 46 47 if (p == NULL) { 47 48 if (factory->on_block_free) 48 49 factory->on_block_free(factory, size); 50 } else { 51 /* Apply signature when PJ_SAFE_POOL is set. It will move 52 * "p" pointer forward. 53 */ 54 APPLY_SIG(p, size); 49 55 } 50 56 … … 59 65 if (factory->on_block_free) 60 66 factory->on_block_free(factory, size); 67 68 /* Check and remove signature when PJ_SAFE_POOL is set. It will 69 * move "mem" pointer backward. 70 */ 71 REMOVE_SIG(mem, size); 72 73 /* Note that when PJ_SAFE_POOL is set, the actual size of the block 74 * is size + SIG_SIZE*2. 75 */ 61 76 62 77 free(mem);
Note: See TracChangeset
for help on using the changeset viewer.