Start to fix talloc memlimits with talloc pools.
authorJeremy Allison <jra@samba.org>
Tue, 27 Aug 2013 19:36:23 +0000 (12:36 -0700)
committerStefan Metzmacher <metze@samba.org>
Tue, 10 Mar 2015 09:55:35 +0000 (10:55 +0100)
commit3bf9b642a72c2a271db96f51ee1a1139a2b1273a
tree3470ee10bfc2a9206a396193b46abc06498788b9
parent62d6944515c19e99d6b4e8a956d4db1aea85d67a
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