From: Pekka Riikonen Date: Wed, 12 Sep 2007 11:38:43 +0000 (+0000) Subject: Better comments. X-Git-Tag: 1.2.beta1~113 X-Git-Url: http://git.silcnet.org/gitweb/?p=crypto.git;a=commitdiff_plain;h=7422f5b12718584305bedff267b8accfa7a23086 Better comments. --- diff --git a/lib/silcutil/silcstack.c b/lib/silcutil/silcstack.c index 03b18b5c..02e2e0c2 100644 --- a/lib/silcutil/silcstack.c +++ b/lib/silcutil/silcstack.c @@ -179,12 +179,13 @@ SilcStack silc_stack_alloc(SilcUInt32 stack_size, SilcStack parent) if (parent) { /* Get stack from parent. The stack itself is allocated from the - parent. */ + parent (but does not consume parent's own stack). */ e = silc_stack_ref_stack(parent, stack_size, &si, &bsize); if (!e) return NULL; - /* Allocate stack from the parent */ + /* Allocate stack from the returned stack. We allocate ourselves from + our own stack. */ stack = silc_stack_alloc_block(parent, e, 1, sizeof(*stack)); if (!stack) { silc_stack_unref_stack(parent, e); @@ -199,8 +200,8 @@ SilcStack silc_stack_alloc(SilcUInt32 stack_size, SilcStack parent) stack->lock = parent->lock; silc_list_init(stack->stacks, struct SilcStackDataEntryStruct, next); - /* Allocate stack frames from the parent */ - stack->frames = silc_stack_alloc_block(parent, e, SILC_STACK_BLOCK_NUM, + /* Allocate stack frames from the stack itself */ + stack->frames = silc_stack_alloc_block(stack, e, SILC_STACK_BLOCK_NUM, sizeof(*stack->frames)); if (!stack->frames) { silc_stack_unref_stack(parent, e);