<div dir="ltr"><div>At present, alloting memory with size of ngx_slab_max_size causes</div><div><br></div><div>1) an internal fragmentation, size of ngx_slab_max_size, comes into being</div><div><br></div><div>2) the slot with index of (ngx_pagesize_shift - pool->min_shift - 1)</div>
<div> is the right slot for this size.</div><div><br></div><div><br></div><div><div># HG changeset patch</div><div># User Jianjun Zheng <<a href="mailto:codeeply@gmail.com">codeeply@gmail.com</a>></div><div># Date 1403080799 -28800</div>
<div># Wed Jun 18 16:39:59 2014 +0800</div><div># Node ID 1704335dd810e2e2abb2b393b4f7b7c9004c6012</div><div># Parent ec919574cc14f7781c0ca212cffec586f88eec40</div><div>Core: bugfix for the ngx_slab_max_size case</div>
<div><br></div><div>diff -r ec919574cc14 -r 1704335dd810 src/core/ngx_slab.c</div><div>--- a/src/core/ngx_slab.c<span class="" style="white-space:pre"> </span>Tue Jun 17 16:51:25 2014 +0400</div><div>+++ b/src/core/ngx_slab.c<span class="" style="white-space:pre"> </span>Wed Jun 18 16:39:59 2014 +0800</div>
<div>@@ -160,7 +160,7 @@</div><div> ngx_uint_t i, slot, shift, map;</div><div> ngx_slab_page_t *page, *prev, *slots;</div><div> </div><div>- if (size >= ngx_slab_max_size) {</div><div>+ if (size > ngx_slab_max_size) {</div>
<div> </div><div> ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, ngx_cycle->log, 0,</div><div> "slab alloc: %uz", size);</div></div><div><br></div></div>