Skip to content

Commit

Permalink
Slab: fixed the number of pages calculation.
Browse files Browse the repository at this point in the history
When estimating the number of pages, do not count memory for slots.
In some cases this gives one extra usable memory page.
  • Loading branch information
mdocguard committed Dec 7, 2016
1 parent 4cf8943 commit 16de9fc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/ngx_slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand Down

0 comments on commit 16de9fc

Please sign in to comment.