summaryrefslogtreecommitdiffstats
path: root/src/fastd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fastd.h')
-rw-r--r--src/fastd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fastd.h b/src/fastd.h
index 2dd0996..9223ffe 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -363,11 +363,11 @@ static inline size_t alignto(size_t l, size_t a) {
return ((l+a-1)/a)*a;
}
-static inline fastd_buffer_t fastd_buffer_alloc(size_t len, size_t head_space, size_t tail_space) {
+static inline fastd_buffer_t fastd_buffer_alloc(const fastd_context_t *ctx, size_t len, size_t head_space, size_t tail_space) {
size_t base_len = head_space+len+tail_space;
void *ptr;
if (posix_memalign(&ptr, 16, base_len))
- return (fastd_buffer_t){ .base = NULL, .base_len = 0, .data = NULL, .len = 0 };
+ exit_errno(ctx, "posix_memalign");
return (fastd_buffer_t){ .base = ptr, .base_len = base_len, .data = ptr+head_space, .len = len };
}