From: Rainer Jung Date: Mon, 17 Jan 2011 22:16:51 +0000 (+0000) Subject: Align proxy_worker_shared in slotmem shm X-Git-Tag: 2.3.11~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a1c15a417c10afcee0858bd7b0e598bf78f2dcb;p=thirdparty%2Fapache%2Fhttpd.git Align proxy_worker_shared in slotmem shm using default APR alignment. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060112 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index b66d524e1af..8e4b6088002 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -336,6 +336,8 @@ typedef struct { unsigned int disablereuse_set:1; } proxy_worker_shared; +#define ALIGNED_PROXY_WORKER_SHARED_SIZE (APR_ALIGN_DEFAULT(sizeof(proxy_worker_shared))) + /* Worker configuration */ struct proxy_worker { int index; /* shm array index */ diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index fb4cc788f86..677ab740239 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -753,11 +753,12 @@ static int balancer_post_config(apr_pool_t *pconf, apr_pool_t *plog, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "Doing create: %s (%s), %d, %d", balancer->name, balancer->sname, - (int)sizeof(proxy_worker_shared), + (int)ALIGNED_PROXY_WORKER_SHARED_SIZE, (int)balancer->max_workers); - rv = storage->create(&new, balancer->sname, sizeof(proxy_worker_shared), - balancer->max_workers, AP_SLOTMEM_TYPE_PREGRAB, pconf); + rv = storage->create(&new, balancer->sname, + ALIGNED_PROXY_WORKER_SHARED_SIZE, + balancer->max_workers, AP_SLOTMEM_TYPE_PREGRAB, pconf); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, "slotmem_create failed"); return !OK;