[njs] Fixed building with CFLAGS=-DNXT_DEBUG_MEMORY=1 by some compilers.

Igor Sysoev igor at sysoev.ru
Thu Dec 8 16:53:02 UTC 2016


details:   http://hg.nginx.org/njs/rev/6a60530c7b6b
branches:  
changeset: 279:6a60530c7b6b
user:      Igor Sysoev <igor at sysoev.ru>
date:      Thu Dec 08 19:50:03 2016 +0300
description:
Fixed building with CFLAGS=-DNXT_DEBUG_MEMORY=1 by some compilers.

diffstat:

 nxt/nxt_mem_cache_pool.c |  26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diffs (43 lines):

diff -r af66e460d7a0 -r 6a60530c7b6b nxt/nxt_mem_cache_pool.c
--- a/nxt/nxt_mem_cache_pool.c	Thu Dec 08 19:29:40 2016 +0300
+++ b/nxt/nxt_mem_cache_pool.c	Thu Dec 08 19:50:03 2016 +0300
@@ -284,19 +284,6 @@ nxt_mem_cache_pool_destroy(nxt_mem_cache
 }
 
 
-nxt_inline u_char *
-nxt_mem_cache_page_addr(nxt_mem_cache_pool_t *pool, nxt_mem_cache_page_t *page)
-{
-    nxt_mem_cache_block_t  *block;
-
-    block = (nxt_mem_cache_block_t *)
-                ((u_char *) page - page->number * sizeof(nxt_mem_cache_page_t)
-                 - offsetof(nxt_mem_cache_block_t, pages));
-
-    return block->start + (page->number << pool->page_size_shift);
-}
-
-
 void *
 nxt_mem_cache_alloc(nxt_mem_cache_pool_t *pool, size_t size)
 {
@@ -379,6 +366,19 @@ nxt_mem_cache_zalign(nxt_mem_cache_pool_
 
 #if !(NXT_DEBUG_MEMORY)
 
+nxt_inline u_char *
+nxt_mem_cache_page_addr(nxt_mem_cache_pool_t *pool, nxt_mem_cache_page_t *page)
+{
+    nxt_mem_cache_block_t  *block;
+
+    block = (nxt_mem_cache_block_t *)
+                ((u_char *) page - page->number * sizeof(nxt_mem_cache_page_t)
+                 - offsetof(nxt_mem_cache_block_t, pages));
+
+    return block->start + (page->number << pool->page_size_shift);
+}
+
+
 static void *
 nxt_mem_cache_alloc_small(nxt_mem_cache_pool_t *pool, size_t size)
 {


More information about the nginx-devel mailing list