diff src/core/ngx_palloc.c @ 302:9b7db0df50f0 NGINX_0_5_21

nginx 0.5.21 *) Bugfix: if server has more than about ten locations, then regex locations might be choosen not in that order as they were specified. *) Bugfix: a worker process may got caught in an endless loop on 64-bit platform, if the 33-rd or next in succession backend has failed. Thanks to Anton Povarov. *) Bugfix: a bus error might occur on Solaris/sparc64 if the PCRE library was used. Thanks to Andrei Nigmatulin. *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 28 May 2007 00:00:00 +0400
parents 704622b2528a
children d16d691432c9
line wrap: on
line diff
--- 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);
             }