aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_slab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_slab.c')
-rw-r--r--src/core/ngx_slab.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/core/ngx_slab.c b/src/core/ngx_slab.c
index 9e7796d50..402387053 100644
--- a/src/core/ngx_slab.c
+++ b/src/core/ngx_slab.c
@@ -83,6 +83,19 @@ static ngx_uint_t ngx_slab_exact_shift;
void
+ngx_slab_sizes_init(void)
+{
+ ngx_uint_t n;
+
+ ngx_slab_max_size = ngx_pagesize / 2;
+ ngx_slab_exact_size = ngx_pagesize / (8 * sizeof(uintptr_t));
+ for (n = ngx_slab_exact_size; n >>= 1; ngx_slab_exact_shift++) {
+ /* void */
+ }
+}
+
+
+void
ngx_slab_init(ngx_slab_pool_t *pool)
{
u_char *p;
@@ -91,16 +104,6 @@ ngx_slab_init(ngx_slab_pool_t *pool)
ngx_uint_t i, n, pages;
ngx_slab_page_t *slots, *page;
- /* STUB */
- if (ngx_slab_max_size == 0) {
- ngx_slab_max_size = ngx_pagesize / 2;
- ngx_slab_exact_size = ngx_pagesize / (8 * sizeof(uintptr_t));
- for (n = ngx_slab_exact_size; n >>= 1; ngx_slab_exact_shift++) {
- /* void */
- }
- }
- /**/
-
pool->min_size = (size_t) 1 << pool->min_shift;
slots = ngx_slab_slots(pool);