Could anyone can tell me why the operator in this code is '>='?


void *
ngx_slab_alloc_locked(ngx_slab_pool_t *pool, size_t size)
size_t s;
uintptr_t p, n, m, mask, *bitmap;
ngx_uint_t i, slot, shift, map;
ngx_slab_page_t *page, *prev, *slots;

if (size >= ngx_slab_max_size) {                // why not '>' ?

    ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, ngx_cycle->log, 0,
                   "slab alloc: %uz", size);

Posted at Nginx Forum:

if a page size is 4096 bytes, then the ngx_slab_max_size is 2048 bytes.
When allocate 2048 bytes memory using nginx slab, it will get a total
page. Is this a waste of memory?

please explain. thanks.

Posted at Nginx Forum: