/* #define SILC_STACK_DEBUG 1 */
-#include "silcincludes.h"
+#include "silc.h"
/* Allocate the stack */
memory, otherwise memory is aligned. Returns pointer to the memory
or NULL on error. */
-void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, bool aligned)
+void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, SilcBool aligned)
{
void *ptr;
SilcUInt32 bsize, bsize2;
the old memory remains intact. */
void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
- void *ptr, SilcUInt32 size, bool aligned)
+ void *ptr, SilcUInt32 size, SilcBool aligned)
{
SilcUInt32 si = stack->frame->si;
SilcUInt32 bsize;
/* Align the old size if needed */
old_size = (aligned ?
- SILC_STACK_ALIGN(old_size, SILC_STACK_DEFAULT_ALIGN) : old_size);
+ SILC_STACK_ALIGN(old_size,
+ SILC_STACK_DEFAULT_ALIGN) : old_size);
/* Compute the size of current stack block */
bsize = SILC_STACK_BLOCK_SIZE(stack, si);
/* Now check that the new size fits to this block */
if (stack->stack[si]->bytes_left >= size) {
/* It fits, so simply return the old pointer */
- size = (aligned ? SILC_STACK_ALIGN(size, SILC_STACK_DEFAULT_ALIGN) : size);
+ size = (aligned ? SILC_STACK_ALIGN(size,
+ SILC_STACK_DEFAULT_ALIGN) : size);
stack->stack[si]->bytes_left -= (size - old_size);
SILC_STACK_STAT(stack, bytes_malloc, (size - old_size));
return ptr;