Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-05-21 17:49:35 +0400
committerIgor Sysoev <igor@sysoev.ru>2007-05-21 17:49:35 +0400
commit2517fbf2b8e2306b83102ffeda0c54b5a15780a3 (patch)
tree4d007d8554bf5e7e6cd5dead403d6587f17acc1d /src
parent0687cb9d9932e3ff3e04082a024a7ae5859ea0a7 (diff)
use memory optimization for i386 and amd64 only:
this fixes SIGBUS in PCRE on sparc64
Diffstat (limited to 'src')
-rw-r--r--src/core/ngx_palloc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c
index 4288bf10a..2e72a0f3b 100644
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -97,10 +97,21 @@ ngx_palloc(ngx_pool_t *pool, size_t size)
for ( ;; ) {
+#if (NGX_HAVE_NONALIGNED)
+
+ /*
+ * allow non-aligned memory blocks for small allocations (1, 2,
+ * or 3 bytes) and for odd length strings (struct's have aligned
+ * size)
+ */
+
if (size < sizeof(int) || (size & 1)) {
m = p->last;
- } else {
+ } else
+#endif
+
+ {
m = ngx_align_ptr(p->last, NGX_ALIGNMENT);
}