diff options
author | Volker Lendecke <vl@samba.org> | 2008-01-05 18:26:54 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-02-11 15:07:46 +0100 |
commit | 7a9033fb2d2057dc8104d9b6f22c94e83e36f8ce (patch) | |
tree | 226d18401f497e911fec56f11957bc172ff28e02 /source4/auth/auth_winbind.c | |
parent | 81abb395e02116eda0f0f3d00843e27fc158e1c0 (diff) | |
download | samba-7a9033fb2d2057dc8104d9b6f22c94e83e36f8ce.tar.gz samba-7a9033fb2d2057dc8104d9b6f22c94e83e36f8ce.tar.bz2 samba-7a9033fb2d2057dc8104d9b6f22c94e83e36f8ce.zip |
Implement talloc_pool()
A talloc pool is a chunk of memory that can be used as a context for further
talloc calls. Allocations with the pool as the parent just chew from that
memory by incrementing a pointer. If the talloc pool is full, then we fall back
to the normal system-level malloc(3) to get memory.
The use case for talloc pools is the transient memory that is used for handling
a single SMB request. Incrementing a pointer will be way faster than any malloc
implementation.
There is a downside of this: If you use talloc_steal() to move something out of
the pool, the whole pool memory is kept around until the last object inside the
pool is freed. So if you talloc_free() the pool, it might happen that the
memory is freed later. So don't hang anything off a talloc pool that should
live long.
Volker
(This used to be commit 60ef9a84f0bd18d48e453c08aa420d17275e0881)
Diffstat (limited to 'source4/auth/auth_winbind.c')
0 files changed, 0 insertions, 0 deletions