summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/talloc_stack.h1
-rw-r--r--source3/lib/talloc_stack.c18
2 files changed, 17 insertions, 2 deletions
diff --git a/source3/include/talloc_stack.h b/source3/include/talloc_stack.h
index 331893cbd6..a2a12f8a63 100644
--- a/source3/include/talloc_stack.h
+++ b/source3/include/talloc_stack.h
@@ -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.
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.
*/