[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-unstable-1242-gbe6fe38
Volker Lendecke
vl at samba.org
Thu Jan 10 09:34:42 GMT 2008
The branch, v3-2-test has been updated
via be6fe381168321ae62e079cd977cbef675c532d4 (commit)
from 329b924cba8225002ca40db26c45b31d141a0925 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit be6fe381168321ae62e079cd977cbef675c532d4
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jan 10 09:53:51 2008 +0100
Form a proper hierarchy in talloc_stack
This way talloc_stackframe() can benefit from a pool put on the stack further
up. No need to remove talloc_stackframe().
-----------------------------------------------------------------------
Summary of changes:
source/lib/talloc_stack.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/lib/talloc_stack.c b/source/lib/talloc_stack.c
index 08ef228..2722fb9 100644
--- a/source/lib/talloc_stack.c
+++ b/source/lib/talloc_stack.c
@@ -66,7 +66,7 @@ static int talloc_pop(TALLOC_CTX *frame)
static TALLOC_CTX *talloc_stackframe_internal(size_t poolsize)
{
- TALLOC_CTX **tmp, *top;
+ TALLOC_CTX **tmp, *top, *parent;
if (talloc_stack_arraysize < talloc_stacksize + 1) {
tmp = TALLOC_REALLOC_ARRAY(NULL, talloc_stack, TALLOC_CTX *,
@@ -78,10 +78,17 @@ static TALLOC_CTX *talloc_stackframe_internal(size_t poolsize)
talloc_stack_arraysize = talloc_stacksize + 1;
}
+ if (talloc_stacksize == 0) {
+ parent = talloc_stack;
+ }
+ else {
+ parent = talloc_stack[talloc_stacksize-1];
+ }
+
if (poolsize) {
- top = talloc_pool(talloc_stack, poolsize);
+ top = talloc_pool(parent, poolsize);
} else {
- top = talloc_new(talloc_stack);
+ top = talloc_new(parent);
}
if (top == NULL) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list