mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
Add the calls to make use of talloc_pools in a talloc_stackframe.
Jeremy. (This used to be commit d27e6c0548d21394f6399d3b737d175ffed8420d)
This commit is contained in:
parent
1ed4fcb271
commit
5df6018114
@ -45,6 +45,7 @@
|
||||
*/
|
||||
|
||||
TALLOC_CTX *talloc_stackframe(void);
|
||||
TALLOC_CTX *talloc_stackframe_pool(size_t poolsize);
|
||||
|
||||
/*
|
||||
* Get us the current top of the talloc stack.
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user