[nginx] Slab: removed redundant page calculation (ticket #1721).

Maxim Dounin mdounin at mdounin.ru
Tue Feb 12 19:41:40 UTC 2019


details:   https://hg.nginx.org/nginx/rev/d97d09ef3afe
branches:  
changeset: 7457:d97d09ef3afe
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Tue Feb 12 21:51:15 2019 +0300
description:
Slab: removed redundant page calculation (ticket #1721).

diffstat:

 src/core/ngx_slab.c |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (15 lines):

diff --git a/src/core/ngx_slab.c b/src/core/ngx_slab.c
--- a/src/core/ngx_slab.c
+++ b/src/core/ngx_slab.c
@@ -635,10 +635,9 @@ ngx_slab_free_locked(ngx_slab_pool_t *po
             goto fail;
         }
 
-        n = ((u_char *) p - pool->start) >> ngx_pagesize_shift;
         size = slab & ~NGX_SLAB_PAGE_START;
 
-        ngx_slab_free_pages(pool, &pool->pages[n], size);
+        ngx_slab_free_pages(pool, page, size);
 
         ngx_slab_junk(p, size << ngx_pagesize_shift);
 


More information about the nginx-devel mailing list