diff options
author | Greg Stein <gstein@apache.org> | 2011-05-09 05:23:45 +0000 |
---|---|---|
committer | Greg Stein <gstein@apache.org> | 2011-05-09 05:23:45 +0000 |
commit | 232fd91b1e575a87ef3772cd5b377cc3e07a61fb (patch) | |
tree | fc4e62b8f13e20bf5bd2e3526f1cd9b2e8f5c85f | |
parent | 3e523eba6b14c8179cfb79c434b048c33a81cda3 (diff) | |
download | apr-232fd91b1e575a87ef3772cd5b377cc3e07a61fb.tar.gz |
Minor updates to track changes in pocore: the "post" concept has been
removed in favor of just using subpools (which are very fast).
* memory/unix/apr_pools.c:
(): always define USE_POCORE on the branch
(struct apr_pool_t): remove the post and add STRUCTURE_POOL as a
reference to the pool where we placed the apr_pool_t structure. It is
also the owner of the actual pool used for all allocations.
(apr_pool_clear): clear the pool rather than returning to the post
marker. note: this clear the allocation pool, not the pool where we
placed the structure.
(apr_pool_destroy): destroy the structure pool, which also takes down
the child allocation pool.
(apr_pool_create_ex): adjust the setup of the pool structure, and create
an extra pool for the allocations (distinct from where we placed the
structure itself).
* tables/apr_hash.c:
(): always define USE_POCORE on the branch
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/gstein-pocore@1100890 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | memory/unix/apr_pools.c | 19 | ||||
-rw-r--r-- | tables/apr_hash.c | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 2e6284144..69682a1a8 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -31,7 +31,7 @@ #include "apr_want.h" #include "apr_env.h" -/*#define USE_POCORE*/ +#define USE_POCORE #ifdef USE_POCORE #include "pc_memory.h" #include "pc_misc.h" @@ -478,7 +478,7 @@ struct debug_node_t { struct apr_pool_t { #ifdef USE_POCORE pc_pool_t *pcpool; - pc_post_t *post; + pc_pool_t *structure_pool; #else apr_pool_t *parent; apr_pool_t *child; @@ -796,7 +796,7 @@ APR_DECLARE(void) apr_pool_clear(apr_pool_t *pool) pool->user_data = NULL; #ifdef USE_POCORE - pc_post_recall(pool->post); + pc_pool_clear(pool->pcpool); #else /* Find the node attached to the pool structure, reset it, make * it the active node and free the rest of the nodes. @@ -843,7 +843,7 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) free_proc_chain(pool->subprocesses); #ifdef USE_POCORE - pc_pool_destroy(pool->pcpool); + pc_pool_destroy(pool->structure_pool); #else /* Remove the pool from the parents child list */ if (pool->parent) { @@ -933,12 +933,13 @@ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, } pool = pc_alloc(pcpool, sizeof(*pool)); - pool->pcpool = pcpool; + pool->structure_pool = pcpool; - /* The APR pool is allocated within the PoCore pool. We don't want - to clear the pool and toss the APR pool. Set a post that we can - use for "clearing the [APR] pool". */ - pool->post = pc_post_create(pcpool); + /* ### ugh. in order to clear the pool, without destroying our + ### companion structure (*pool), we need to create a subpool + ### for the allocations. it would be nice if we could construct + ### pcpool as "small" rather than the default 8k ctx size. */ + pool->pcpool = pc_pool_create(pcpool); } #else if (allocator == NULL) diff --git a/tables/apr_hash.c b/tables/apr_hash.c index e52ba0d46..ba7b040f0 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -32,7 +32,7 @@ #include <stdio.h> #endif -/*#define USE_POCORE*/ +#define USE_POCORE #ifdef USE_POCORE #include "pc_types.h" #include "pc_memory.h" |