diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-07-03 14:18:17 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-07-03 14:18:17 +0000 |
commit | 63147d55f091ec8ba1a5b57cb04b421938ec9fde (patch) | |
tree | 472a6675304f57a815f6f0380ab631373be766a6 /pjlib | |
parent | 589260d10d6915e1f55724099508fc742012b838 (diff) |
Fixed minor bug in pool_caching.c that prevent pool from being reused if the capacity has changed when the pool is released
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@581 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/string.h | 13 | ||||
-rw-r--r-- | pjlib/src/pj/pool_caching.c | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/pjlib/include/pj/string.h b/pjlib/include/pj/string.h index 5c2cc251..7c513e7c 100644 --- a/pjlib/include/pj/string.h +++ b/pjlib/include/pj/string.h @@ -543,6 +543,19 @@ PJ_DECL(int) pj_utoa(unsigned long val, char *buf); */ PJ_DECL(int) pj_utoa_pad( unsigned long val, char *buf, int min_dig, int pad); + +/** + * Fill the memory location with zero. + * + * @param dst The destination buffer. + * @param size The number of bytes. + */ +PJ_INLINE(void) pj_bzero(void *dst, pj_size_t size) +{ + bzero(dst, size); +} + + /** * Fill the memory location with value. * diff --git a/pjlib/src/pj/pool_caching.c b/pjlib/src/pj/pool_caching.c index 4f9904e8..1c9f3e2f 100644 --- a/pjlib/src/pj/pool_caching.c +++ b/pjlib/src/pj/pool_caching.c @@ -198,6 +198,8 @@ static void cpool_release_pool( pj_pool_factory *pf, pj_pool_t *pool) pj_pool_get_used_size(pool)*100/pool_capacity)); pj_pool_reset(pool); + pool_capacity = pj_pool_get_capacity(pool); + /* * Otherwise put the pool in our recycle list. */ |