]> git.ipfire.org Git - thirdparty/bind9.git/commit
Add a static pre-allocated buffer to isc_buffer_t
authorOndřej Surý <ondrej@isc.org>
Thu, 15 Dec 2022 21:51:52 +0000 (22:51 +0100)
committerOndřej Surý <ondrej@isc.org>
Tue, 20 Dec 2022 18:13:48 +0000 (19:13 +0100)
commit2ddea1e41c632550afb28ddb60aa1ee19a05bda5
treee7dbee8c92a0425844c21faa3fed8f7d9de2d2c5
parent6bd2b34180d74146423a6c637f58d3bb8164a29c
Add a static pre-allocated buffer to isc_buffer_t

When the buffer is allocated via isc_buffer_allocate() and the size is
smaller or equal ISC_BUFFER_STATIC_SIZE (currently 512 bytes), the
buffer will be allocated as a flexible array member in the buffer
structure itself instead of allocating it on the heap.  This should help
when the buffer is used on the hot-path with small allocations.
lib/isc/buffer.c
lib/isc/include/isc/buffer.h
tests/isc/buffer_test.c