Mercurial > hg > nginx
comparison src/core/ngx_slab.c @ 2610:3a9b22405138
delete old debugging and info
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 27 Mar 2009 16:37:39 +0000 |
parents | ae3bfe9aa093 |
children | 2bce3f6416c6 |
comparison
equal
deleted
inserted
replaced
2609:ad99a49cd313 | 2610:3a9b22405138 |
---|---|
3 * Copyright (C) Igor Sysoev | 3 * Copyright (C) Igor Sysoev |
4 */ | 4 */ |
5 | 5 |
6 #include <ngx_config.h> | 6 #include <ngx_config.h> |
7 #include <ngx_core.h> | 7 #include <ngx_core.h> |
8 | |
9 /* | |
10 | |
11 12 | |
12 2048 2 11 | |
13 1024 4 10 | |
14 512 8 9 | |
15 256 16 8 | |
16 | |
17 128 32 4 32 7 | |
18 | |
19 64 64 8 63 6 1 | |
20 32 128 16 127 5 1 | |
21 16 256 32 254 4 2 | |
22 8 512 64 504 3 8 | |
23 | |
24 */ | |
25 | 8 |
26 | 9 |
27 #define NGX_SLAB_PAGE_MASK 3 | 10 #define NGX_SLAB_PAGE_MASK 3 |
28 #define NGX_SLAB_PAGE 0 | 11 #define NGX_SLAB_PAGE 0 |
29 #define NGX_SLAB_BIG 1 | 12 #define NGX_SLAB_BIG 1 |
144 m = pages - (pool->end - pool->start) / ngx_pagesize; | 127 m = pages - (pool->end - pool->start) / ngx_pagesize; |
145 if (m > 0) { | 128 if (m > 0) { |
146 pages -= m; | 129 pages -= m; |
147 pool->pages->slab = pages; | 130 pool->pages->slab = pages; |
148 } | 131 } |
149 | |
150 #if 0 | |
151 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "slab: %p, %p, %ui, %d", | |
152 pool, pool->start, pages, | |
153 (pool->end - pool->start) / ngx_pagesize - pages); | |
154 #endif | |
155 } | 132 } |
156 | 133 |
157 | 134 |
158 void * | 135 void * |
159 ngx_slab_alloc(ngx_slab_pool_t *pool, size_t size) | 136 ngx_slab_alloc(ngx_slab_pool_t *pool, size_t size) |