1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-10 04:23:50 +03:00

Add the calls to make use of talloc_pools in a talloc_stackframe.

Jeremy.
This commit is contained in:
Jeremy Allison
2008-01-09 17:07:58 -08:00
parent 287e29d988
commit d27e6c0548
2 changed files with 17 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ static int talloc_pop(TALLOC_CTX *frame)
* not explicitly freed.
*/
TALLOC_CTX *talloc_stackframe(void)
static TALLOC_CTX *talloc_stackframe_internal(size_t poolsize)
{
TALLOC_CTX **tmp, *top;
@@ -78,7 +78,11 @@ TALLOC_CTX *talloc_stackframe(void)
talloc_stack_arraysize = talloc_stacksize + 1;
}
top = talloc_new(talloc_stack);
if (poolsize) {
top = talloc_pool(talloc_stack, poolsize);
} else {
top = talloc_new(talloc_stack);
}
if (top == NULL) {
goto fail;
@@ -94,6 +98,16 @@ TALLOC_CTX *talloc_stackframe(void)
return NULL;
}
TALLOC_CTX *talloc_stackframe(void)
{
return talloc_stackframe_internal(0);
}
TALLOC_CTX *talloc_stackframe_pool(size_t poolsize)
{
return talloc_stackframe_internal(poolsize);
}
/*
* Get us the current top of the talloc stack.
*/