]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: lua: use memory pool for hlua struct in applets
authorThierry FOURNIER <thierry.fournier@ozon.io>
Fri, 16 Dec 2016 10:54:07 +0000 (11:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 Dec 2016 15:31:45 +0000 (16:31 +0100)
commitebed6e908a7dc7e9dbf12cefe81951e467156a28
treebbf65c41e4653127d07b592cc97f8e571ecba84c
parentffbf569edba2a10a3d2316cb6d7435944f591cce
MEDIUM: lua: use memory pool for hlua struct in applets

The struct hlua size is 128 bytes. The size is the biggest of all the elements
of the union embedded in the appctx struct. With HTTP2, it is possible that this
appctx struct will be use many times for each connection, so the 128 bytes are
a little bit heavy for the global memory consomation.

This patch replace the embbeded hlua struct by a pointer and an associated memory
pool. Now, the memory for lua is allocated only if it is required.

[wt: the appctx is now down to 160 bytes]
include/types/applet.h
src/hlua.c