lib/param: add a fixed unified lpcfg_string_{free,set,set_upper}() infrastructure
authorStefan Metzmacher <metze@samba.org>
Sat, 28 Nov 2015 09:32:05 +0000 (10:32 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 30 Nov 2015 16:41:28 +0000 (17:41 +0100)
commita84eed532549c1dbad43f963838bc5f13c4fe68d
tree874924a918a26d97d022986a75db61389f08624c
parent0548fc52f99f3f222b4e58f587dd07f92be6707c
lib/param: add a fixed unified lpcfg_string_{free,set,set_upper}() infrastructure

This reduces the memory footprint of empty string options.

smbd -d1 -i with 1400 shares in smb.conf under x64 valgrind massif before this
patch has 7,703,392 bytes peak memory consumption and after this patch
3,321,200 bytes.

This fixes a regression introduced by commit
2dd7c890792cf12049ec13b88aa4e9de23035f9d.

BUG:

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11625
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Nov 30 17:41:28 CET 2015 on sn-devel-104
lib/param/loadparm.c
source3/param/loadparm.c