diff options
author | Ruslan Ermilov <ru@nginx.com> | 2016-12-07 22:25:37 +0300 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2016-12-07 22:25:37 +0300 |
commit | 16de9fc3b52e82d1e2be740be4a1ee9adafb6fbf (patch) | |
tree | 49f23ea37845c40eb84819e10bb19b9d59abd161 /src/core/ngx_slab.c | |
parent | 4cf89436d10b32f9be4373e00c03518d713d1437 (diff) |
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.
Diffstat (limited to 'src/core/ngx_slab.c')
-rw-r--r-- | src/core/ngx_slab.c | 1 |
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))); |