aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2016-12-07 22:25:37 +0300
committerRuslan Ermilov <ru@nginx.com>2016-12-07 22:25:37 +0300
commit16de9fc3b52e82d1e2be740be4a1ee9adafb6fbf (patch)
tree49f23ea37845c40eb84819e10bb19b9d59abd161
parent4cf89436d10b32f9be4373e00c03518d713d1437 (diff)
downloadnginx-16de9fc3b52e82d1e2be740be4a1ee9adafb6fbf.tar.gz
nginx-16de9fc3b52e82d1e2be740be4a1ee9adafb6fbf.zip
Slab: fixed the number of pages calculation.
When estimating the number of pages, do not count memory for slots. In some cases this gives one extra usable memory page.
-rw-r--r--src/core/ngx_slab.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/ngx_slab.c b/src/core/ngx_slab.c
index 4357e8dd9..b33f43f8e 100644
--- a/src/core/ngx_slab.c
+++ b/src/core/ngx_slab.c
@@ -120,6 +120,7 @@ ngx_slab_init(ngx_slab_pool_t *pool)
}
p += n * sizeof(ngx_slab_page_t);
+ size -= n * sizeof(ngx_slab_page_t);
pages = (ngx_uint_t) (size / (ngx_pagesize + sizeof(ngx_slab_page_t)));