summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/talloc_stack.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source3/lib/talloc_stack.c b/source3/lib/talloc_stack.c
index d887b2d415..08ef2281ea 100644
--- a/source3/lib/talloc_stack.c
+++ b/source3/lib/talloc_stack.c
@@ -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.
*/