From: Jim Jagielski Date: Mon, 7 Feb 2011 17:15:02 +0000 (+0000) Subject: Save this for later to be done... recall that .free needs to X-Git-Tag: 2.3.11~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfacdb9a74c1e3b8e244232f1d8126b738af9a0c;p=apache Save this for later to be done... recall that .free needs to exist in shm... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1068019 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/slotmem/mod_slotmem_shm.c b/modules/slotmem/mod_slotmem_shm.c index 84c57bb86a..c09d749bdd 100644 --- a/modules/slotmem/mod_slotmem_shm.c +++ b/modules/slotmem/mod_slotmem_shm.c @@ -48,7 +48,6 @@ typedef struct { apr_size_t size; /* size of each memory slot */ unsigned int num; /* number of mem slots */ - unsigned int free; /* number of free mem slots */ ap_slotmem_type_t type; /* type-specific flags */ } sharedslotdesc_t; @@ -333,7 +332,7 @@ static apr_status_t slotmem_create(ap_slotmem_instance_t **new, } ptr = (char *)apr_shm_baseaddr_get(shm); desc.size = item_size; - desc.free = desc.num = item_num; + desc.num = item_num; desc.type = type; memcpy(ptr, &desc, sizeof(desc)); ptr = ptr + AP_SLOTMEM_OFFSET; @@ -343,13 +342,7 @@ static apr_status_t slotmem_create(ap_slotmem_instance_t **new, * sense if the restore fails? Any? */ if (type & AP_SLOTMEM_TYPE_PERSIST) { - unsigned int i, counter=0; - char *inuse = ptr + basesize; restore_slotmem(ptr, fname, dsize, pool); - for (i=0; idesc.free; - else { - unsigned int i, counter=0; - char *inuse = slot->inuse; - for (i=0; idesc.num; i++, inuse++) { - if (!*inuse) - counter++; - } - return counter; + unsigned int i, counter=0; + char *inuse = slot->inuse; + for (i=0; idesc.num; i++, inuse++) { + if (!*inuse) + counter++; } + return counter; } static apr_size_t slotmem_slot_size(ap_slotmem_instance_t *slot) @@ -567,7 +556,6 @@ static apr_status_t slotmem_grab(ap_slotmem_instance_t *slot, unsigned int *id) } *inuse = 1; *id = i; - slot->desc.free--; return APR_SUCCESS; } @@ -586,7 +574,6 @@ static apr_status_t slotmem_release(ap_slotmem_instance_t *slot, return APR_NOTFOUND; } inuse[id] = 0; - slot->desc.free++; return APR_SUCCESS; }