diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-11-20 08:51:45 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-11-20 08:51:45 +0000 |
commit | 67cd336d88f8a920ea5921936785a1c1553062fb (patch) | |
tree | f76934379e98e22854638a4ddc44b022deefd265 /src/core/ngx_palloc.c | |
parent | cae66582d5e6137d3b53552fcb84520a042841ca (diff) | |
download | nginx-67cd336d88f8a920ea5921936785a1c1553062fb.tar.gz nginx-67cd336d88f8a920ea5921936785a1c1553062fb.zip |
slab allocator in shared memory
Diffstat (limited to 'src/core/ngx_palloc.c')
-rw-r--r-- | src/core/ngx_palloc.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c index 1797e96d0..a0f0085d0 100644 --- a/src/core/ngx_palloc.c +++ b/src/core/ngx_palloc.c @@ -193,46 +193,6 @@ ngx_pcalloc(ngx_pool_t *pool, size_t size) } -void * -ngx_shalloc(size_t size) -{ - u_char *p; - - if (size < sizeof(int) || (size & 1)) { - p = ngx_cycle->shm_last; - - } else { - p = ngx_align_ptr(ngx_cycle->shm_last, NGX_ALIGNMENT); - } - - if ((size_t) (ngx_cycle->shm_end - p) >= size) { - ngx_cycle->shm_last = p + size; - return p; - } - - ngx_log_error(NGX_LOG_EMERG, ngx_cycle->log, 0, - "allocation of %uz bytes in shared memory failed, " - "only %uz are available", - size, ngx_cycle->shm_end - ngx_cycle->shm_last); - - return NULL; -} - - -void * -ngx_shcalloc(size_t size) -{ - void *p; - - p = ngx_shalloc(size); - if (p) { - ngx_memzero(p, size); - } - - return p; -} - - ngx_pool_cleanup_t * ngx_pool_cleanup_add(ngx_pool_t *p, size_t size) { |