diff options
author | Yann Ylavic <ylavic@apache.org> | 2018-02-07 00:43:41 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2018-02-07 00:43:41 +0100 |
commit | 9f8a7d55ca47f2c405fa4abc67c4636533f7704e (patch) | |
tree | 030a75678203868a863cc66ded113e67c45b5af6 /modules | |
parent | mod_slotmem_shm: follow up tp r1822509. (diff) | |
download | apache2-9f8a7d55ca47f2c405fa4abc67c4636533f7704e.tar.xz apache2-9f8a7d55ca47f2c405fa4abc67c4636533f7704e.zip |
mod_slotmem_shm: follow up tp r1822509.
Complete layout of SHM and persited file (ascii art).
Simplify an "if" condition, no functional change.
[Reverted by r1831868]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1823416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r-- | modules/slotmem/mod_slotmem_shm.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c index 64f776868b..2986df4391 100644 --- a/modules/slotmem/mod_slotmem_shm.c +++ b/modules/slotmem/mod_slotmem_shm.c @@ -56,13 +56,19 @@ struct ap_slotmem_instance_t { }; /* - * Memory layout: - * sharedslotdesc_t | num_free | slots | isuse array | - * ^ ^ - * | . base - * . persist (also num_free) + * Layout for SHM and persited file : + * + * +-------------------------------------------------------------+~> + * | desc | num_free | base (slots) | inuse (array) | md5 | desc | compat.. + * +------+-----------------------------------------+------------+~> + * ^ ^ ^ \ / ^ : + * |______|_____________ SHM (mem->@) ______________| | _____|__/ + * | |/ | + * | ^ v | + * |_____________________ File (mem->persist + [meta]) __| */ + /* global pool and list of slotmem we are handling */ static struct ap_slotmem_instance_t *globallistmem = NULL, **retained_globallistmem = NULL; @@ -351,8 +357,7 @@ static apr_status_t slotmem_doall(ap_slotmem_instance_t *mem, ptr = (char *)mem->base; inuse = mem->inuse; for (i = 0; i < mem->desc->num; i++, inuse++) { - if (!AP_SLOTMEM_IS_PREGRAB(mem) || - (AP_SLOTMEM_IS_PREGRAB(mem) && *inuse)) { + if (!AP_SLOTMEM_IS_PREGRAB(mem) || *inuse) { retval = func((void *) ptr, data, pool); if (retval != APR_SUCCESS) break; |