diff src/core/ngx_palloc.c @ 380:bc21d9cd9c54 NGINX_0_7_2

nginx 0.7.2 *) Feature: now nginx supports EDH key exchange ciphers. *) Feature: the "ssl_dhparam" directive. *) Feature: the $ssl_client_cert variable. Thanks to Manlio Perillo. *) Bugfix: after changing URI via a "rewrite" directive nginx did not search a new location; bug appeared in 0.7.1. Thanks to Maxim Dounin. *) Bugfix: nginx could not be built without PCRE library; bug appeared in 0.7.1. *) Bugfix: when a request to a directory was redirected with the slash added, nginx dropped a query string from the original request.
author Igor Sysoev <http://sysoev.ru>
date Mon, 16 Jun 2008 00:00:00 +0400
parents b743d290eb3b
children 984bb0b1399b
line wrap: on
line diff
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -99,8 +99,6 @@ 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
@@ -110,10 +108,7 @@ ngx_palloc(ngx_pool_t *pool, size_t size
             if (size < sizeof(int) || (size & 1)) {
                 m = p->last;
 
-            } else
-#endif
-
-            {
+            } else {
                 m = ngx_align_ptr(p->last, NGX_ALIGNMENT);
             }
 
@@ -177,6 +172,17 @@ ngx_palloc(ngx_pool_t *pool, size_t size
 }
 
 
+void *
+ngx_palloc_aligned(ngx_pool_t *pool, size_t size)
+{
+    if (size & 1) {
+        size++;
+    }
+
+    return ngx_palloc(pool, size);
+}
+
+
 ngx_int_t
 ngx_pfree(ngx_pool_t *pool, void *p)
 {