#1658 closed enhancement (duplicate)

Optimize memory usage in ngx_reset_pool

Reported by: chronolaw@… Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.15.x
Keywords: Cc:
uname -a:
nginx -V: nginx version: nginx/1.15.3

Description

In ngx_pool_t, the overhead of first block is sizeof(ngx_pool_t), the overhead of other blocks is sizeof(ngx_pool_data_t). But in function ngx_reset_pool, the last pointer always move to 'p + sizeof(ngx_pool_t)', and wastes some(small) memory.

I think we can optimize it, please see the patch, thanks.

Attachments (1)

ngx_palloc.c.patch (784 bytes ) - added by chronolaw@… 21 months ago.

Download all attachments as: .zip

Change History (2)

by chronolaw@…, 21 months ago

Attachment: ngx_palloc.c.patch added

comment:1 by Maxim Dounin, 21 months ago

Resolution: duplicate
Status: newclosed

Duplicate of #1594.

Note: See TracTickets for help on using tickets.