aboutsummaryrefslogtreecommitdiffstats
path: root/src/stack.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-09 10:28:59 +0200
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commite2d2c7b027ac9ac142ae306d248f2d687df211eb (patch)
treec8326d3deb8b9bb23e2c815d88b917220ef0d85b /src/stack.h
parent68b30967872915b93c600e353d2fd6d5fb4987c6 (diff)
downloadserd-e2d2c7b027ac9ac142ae306d248f2d687df211eb.tar.gz
serd-e2d2c7b027ac9ac142ae306d248f2d687df211eb.tar.bz2
serd-e2d2c7b027ac9ac142ae306d248f2d687df211eb.zip
Align nodes with posix_memalign if possible
Diffstat (limited to 'src/stack.h')
-rw-r--r--src/stack.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stack.h b/src/stack.h
index dbb196ae..8764afad 100644
--- a/src/stack.h
+++ b/src/stack.h
@@ -17,7 +17,7 @@
#ifndef SERD_STACK_H
#define SERD_STACK_H
-#include "serd_internal.h"
+#include "system.h"
#include <assert.h>
#include <stddef.h>
@@ -38,10 +38,10 @@ typedef struct {
#define SERD_STACK_BOTTOM sizeof(void*)
static inline SerdStack
-serd_stack_new(size_t size)
+serd_stack_new(size_t size, size_t align)
{
SerdStack stack;
- stack.buf = (char*)calloc(size, 1);
+ stack.buf = (char*)serd_calloc_aligned(size, align);
stack.buf_size = size;
stack.size = SERD_STACK_BOTTOM;
return stack;