summaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 5b2e16a..58e8023 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -32,7 +32,7 @@
#pragma once
-#include "log.h"
+#include "alloc.h"
/** A buffer descriptor */
@@ -55,10 +55,7 @@ struct fastd_buffer {
*/
static inline fastd_buffer_t fastd_buffer_alloc(const size_t len, size_t head_space, size_t tail_space) {
size_t base_len = head_space+len+tail_space;
- void *ptr;
- int err = posix_memalign(&ptr, 16, base_len);
- if (err)
- exit_error("posix_memalign: %s", strerror(err));
+ void *ptr = fastd_alloc_aligned(base_len, 16);
return (fastd_buffer_t){ .base = ptr, .base_len = base_len, .data = ptr+head_space, .len = len };
}