Open
Description
Does ngx_pool_t
do non-noop free
s if done in LIFO order? If so, then it would also make sense for it to support in-place realloc
s for the last allocation, and override the provided default methods for Allocator::grow
and Allocator::shrink
here as well.
Allowing the last allocation to grow in-place, even in bump allocators, is particularly nice when building Vec
s of an unknown number of elements and which end up resizing and growing their underlying storage.
Originally posted by @fitzgen in #164 (comment)
The approach has been used in ngx_array_push
since nginx 0.1, and the underlying structures are quite stable. The optimization would be quite beneficial for building arrays and strings on pool.
Metadata
Metadata
Assignees
Labels
No labels