Skip to content

Commit

Permalink
Deprecate caching pool fields: used_size & peak_used_size.
Browse files Browse the repository at this point in the history
  • Loading branch information
nanangizz committed Mar 22, 2024
1 parent a7c4d83 commit 773b5e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pjlib/include/pj/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,16 @@ struct pj_caching_pool

/**
* Total size of memory currently used by application.
*
* This field is deprecated.
*/
pj_size_t used_size;

/**
* The maximum size of memory used by application throughout the life
* of the caching pool.
*
* This field is deprecated.
*/
pj_size_t peak_used_size;

Expand Down
8 changes: 6 additions & 2 deletions pjlib/src/pj/pool_caching.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ PJ_DEF(void) pj_caching_pool_init( pj_caching_pool *cp,
cp->factory.create_pool = &cpool_create_pool;
cp->factory.release_pool = &cpool_release_pool;
cp->factory.dump_status = &cpool_dump_status;
cp->factory.on_block_alloc = &cpool_on_block_alloc;
cp->factory.on_block_free = &cpool_on_block_free;

/* Deprecated, these callbacks are only used for updating cp.used_size &
* cp.peak_used_size which are no longer used.
*/
//cp->factory.on_block_alloc = &cpool_on_block_alloc;
//cp->factory.on_block_free = &cpool_on_block_free;

pool = pj_pool_create_on_buf("cachingpool", cp->pool_buf, sizeof(cp->pool_buf));
status = pj_lock_create_simple_mutex(pool, "cachingpool", &cp->lock);
Expand Down

0 comments on commit 773b5e9

Please sign in to comment.