]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: buffer: finalize buffer detachment
authorWilly Tarreau <w@1wt.eu>
Tue, 10 Jul 2018 15:43:27 +0000 (17:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:43 +0000 (16:23 +0200)
commitc9fa0480af0a261f87afd23f3f50459d3cc12765
tree3c8c23fc57d1c1803d06cd9f130f758481ab77f6
parentbd1dba8a89bd22cd04c09422e333b2c648cb1b41
MAJOR: buffer: finalize buffer detachment

Now the buffers only contain the header and a pointer to the storage
area which can be anywhere. This will significantly simplify buffer
swapping and will make it possible to map chunks on buffers as well.

The buf_empty variable was removed, as now it's enough to have size==0
and area==NULL to designate the empty buffer (thus a non-allocated head
is the empty buffer by default). buf_wanted for now is indicated by
size==0 and area==(void *)1.

The channels and the checks now embed the buffer's head, and the only
pointer is to the storage area. This slightly increases the unallocated
buffer size (3 extra ints for the empty buffer) but considerably
simplifies dynamic buffer management. It will also later permit to
detach unused checks.

The way the struct buffer is arranged has proven quite efficient on a
number of tests, which makes sense given that size is always accessed
and often first, followed by the othe ones.
29 files changed:
include/common/buf.h
include/common/buffer.h
include/proto/channel.h
include/proto/stream_interface.h
include/types/channel.h
include/types/checks.h
include/types/compression.h
include/types/spoe.h
src/backend.c
src/buffer.c
src/cache.c
src/channel.c
src/checks.c
src/cli.c
src/compression.c
src/filters.c
src/flt_http_comp.c
src/flt_spoe.c
src/flt_trace.c
src/h1.c
src/haproxy.c
src/hlua.c
src/mux_h2.c
src/payload.c
src/peers.c
src/proto_http.c
src/stats.c
src/stream.c
src/stream_interface.c