Changeset 1333 for pjproject/trunk/pjlib/src/pj/pool_policy_new.cpp
- 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_new.cpp
r1235 r1333 26 26 * This file contains pool default policy definition and implementation. 27 27 */ 28 #include "pool_signature.h" 28 29 29 30 30 31 static void *operator_new(pj_pool_factory *factory, pj_size_t size) 31 32 { 33 void *mem; 34 32 35 PJ_CHECK_STACK(); 33 36 PJ_UNUSED_ARG(factory); 34 37 PJ_UNUSED_ARG(size); 35 38 36 return new char[size]; 39 mem = (void*) new char[size+(SIG_SIZE << 1)]; 40 41 /* Exception for new operator may be disabled, so.. */ 42 if (mem) { 43 /* Apply signature when PJ_SAFE_POOL is set. It will move 44 * "mem" pointer forward. 45 */ 46 APPLY_SIG(mem, size); 47 } 48 49 return mem; 37 50 } 38 51 … … 42 55 PJ_UNUSED_ARG(factory); 43 56 PJ_UNUSED_ARG(size); 57 58 /* Check and remove signature when PJ_SAFE_POOL is set. It will 59 * move "mem" pointer backward. 60 */ 61 REMOVE_SIG(mem, size); 62 63 /* Note that when PJ_SAFE_POOL is set, the actual size of the block 64 * is size + SIG_SIZE*2. 65 */ 44 66 45 67 char *p = (char*)mem;
Note: See TracChangeset
for help on using the changeset viewer.