Start to fix talloc memlimits with talloc pools.
commitfd0122cc72d161f6b67d3f505e7bd6871445072d
authorJeremy Allison <jra@samba.org>
Tue, 27 Aug 2013 19:36:23 +0000 (27 12:36 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sun, 15 Mar 2015 21:13:08 +0000 (15 22:13 +0100)
tree3181ee4f842e1584546be00a7f6d2c37f5a30073
parent6d0843d3ec711fc2beb34f320331497309419b98
Start to fix talloc memlimits with talloc pools.

Add the functions:

talloc_memlimit_grow(), talloc_memlimit_shrink(),
talloc_memlimit_update_on_free().

as replacements for talloc_memlimit_update().
The interface to talloc_memlimit_update() is very
hard to understand and use. The above functions
are (to me) much clearer.

The goal of these changes is to only update
the memlimits on malloc/free/realloc, not
on every pool allocation. That way we only
count pool creation as allocation from any
imposed limits, not allocation from an already
created pool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit fe790f6cbc9b888a8d613cfb515f0d0c76daad47)
lib/talloc/talloc.c