haproxy/include
Willy Tarreau b686afd568 MINOR: chunks: implement a simple dynamic allocator for trash buffers
The trash buffers are becoming increasingly complex to deal with due to
the code's modularity allowing some functions to be chained and causing
the same chunk buffers to be used multiple times along the chain, possibly
corrupting each other. In fact the trash were designed from scratch for
explicitly not surviving a function call but string manipulation makes
this impossible most of the time while not fullfilling the need for
reliable temporary chunks.

Here we introduce the ability to allocate a temporary trash chunk which
is reserved, so that it will not conflict with the trash chunks other
functions use, and will even support reentrant calls (eg: build_logline).

For this, we create a new pool which is exactly the size of a usual chunk
buffer plus the size of the chunk struct so that these chunks when allocated
are exactly the same size as the ones returned by get_trash_buffer(). These
chunks may fail so the caller must check them, and the caller is also
responsible for freeing them.

The code focuses on minimal changes and ease of reliable backporting
because it will be needed in stable versions in order to support next
patch.
2017-02-08 11:16:29 +01:00
..
common MINOR: chunks: implement a simple dynamic allocator for trash buffers 2017-02-08 11:16:29 +01:00
import CLEANUP: da: move global settings out of the global section 2016-12-21 21:30:54 +01:00
proto MINOR: dns: give ability to dns_init_resolvers() to close a socket when requested 2017-02-03 07:21:32 +01:00
types MINOR: server: extend the flags to 32 bits 2017-01-25 18:49:27 +01:00