Changeset 3082 for pjproject/trunk/pjlib/src/pj/pool.c
- Timestamp:
- Jan 29, 2010 11:20:43 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/pool.c
r3081 r3082 32 32 #endif 33 33 34 #define LOG(expr) PJ_LOG(6,expr) 34 #define LOG(expr) PJ_LOG(6,expr) 35 #define ALIGN_PTR(PTR,ALIGNMENT) (PTR + (-(long)(PTR) & (ALIGNMENT-1))) 35 36 36 37 PJ_DEF_DATA(int) PJ_NO_MEMORY_EXCEPTION; … … 72 73 73 74 /* Set the start pointer, aligning it as needed */ 74 block->cur = (unsigned char*) 75 (((unsigned long)block->buf + PJ_POOL_ALIGNMENT - 1) & 76 ~(PJ_POOL_ALIGNMENT - 1)); 75 block->cur = ALIGN_PTR(block->buf, PJ_POOL_ALIGNMENT); 77 76 78 77 /* Insert in the front of the list. */ … … 217 216 218 217 /* Set the start pointer, aligning it as needed */ 219 block->cur = (unsigned char*) 220 (((unsigned long)block->buf + PJ_POOL_ALIGNMENT - 1) & 221 ~(PJ_POOL_ALIGNMENT - 1)); 218 block->cur = ALIGN_PTR(block->buf, PJ_POOL_ALIGNMENT); 222 219 223 220 pj_list_insert_after(&pool->block_list, block); … … 263 260 264 261 /* Set the start pointer, aligning it as needed */ 265 block->cur = (unsigned char*) 266 (((unsigned long)block->buf + PJ_POOL_ALIGNMENT - 1) & 267 ~(PJ_POOL_ALIGNMENT - 1)); 262 block->cur = ALIGN_PTR(block->buf, PJ_POOL_ALIGNMENT); 268 263 269 264 pool->capacity = block->end - (unsigned char*)pool;
Note: See TracChangeset
for help on using the changeset viewer.