Changeset 4298
- Timestamp:
- Nov 22, 2012 5:00:01 AM (12 years ago)
- Location:
- pjproject/trunk/pjlib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/pool.h
r3553 r4298 510 510 */ 511 511 PJ_IDECL(void*) pj_pool_alloc_from_block(pj_pool_block *block, pj_size_t size); 512 PJ_DECL(void*) pj_pool_allocate_find(pj_pool_t *pool, unsignedsize);512 PJ_DECL(void*) pj_pool_allocate_find(pj_pool_t *pool, pj_size_t size); 513 513 514 514 -
pjproject/trunk/pjlib/include/pj/pool_i.h
r3553 r4298 48 48 size = (size + PJ_POOL_ALIGNMENT) & ~(PJ_POOL_ALIGNMENT-1); 49 49 } 50 if (( unsigned)(block->end - block->cur) >= size) {50 if ((pj_size_t)(block->end - block->cur) >= size) { 51 51 void *ptr = block->cur; 52 52 block->cur += size; -
pjproject/trunk/pjlib/src/pj/pool.c
r3553 r4298 89 89 * (depending on whether the pool is allowed to resize). 90 90 */ 91 PJ_DEF(void*) pj_pool_allocate_find(pj_pool_t *pool, unsignedsize)91 PJ_DEF(void*) pj_pool_allocate_find(pj_pool_t *pool, pj_size_t size) 92 92 { 93 93 pj_pool_block *block = pool->block_list.next; … … 122 122 size + sizeof(pj_pool_block) + PJ_POOL_ALIGNMENT) 123 123 { 124 unsignedcount;124 pj_size_t count; 125 125 count = (size + pool->increment_size + sizeof(pj_pool_block) + 126 126 PJ_POOL_ALIGNMENT) / -
pjproject/trunk/pjlib/src/pj/pool_caching.c
r3553 r4298 179 179 180 180 /* Update pool manager's free capacity. */ 181 cp->capacity -= pj_pool_get_capacity(pool); 181 if (cp->capacity > pj_pool_get_capacity(pool)) { 182 cp->capacity -= pj_pool_get_capacity(pool); 183 } else { 184 cp->capacity = 0; 185 } 182 186 183 187 PJ_LOG(6, (pool->obj_name, "pool reused, size=%u", pool->capacity)); … … 200 204 { 201 205 pj_caching_pool *cp = (pj_caching_pool*)pf; 202 unsignedpool_capacity;206 pj_size_t pool_capacity; 203 207 unsigned i; 204 208
Note: See TracChangeset
for help on using the changeset viewer.