From d83553b4a2e942f410d56d92bef34def9424a494 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 6 Apr 2023 14:52:50 -0400 Subject: bfstd: Add an aligned_alloc()/posix_memalign() wrapper --- src/bfstd.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/bfstd.h') diff --git a/src/bfstd.h b/src/bfstd.h index e4fd1f1..ee4cf16 100644 --- a/src/bfstd.h +++ b/src/bfstd.h @@ -105,6 +105,18 @@ char *xgetdelim(FILE *file, char delim); // #include +/** + * Portable version of aligned_alloc()/posix_memalign(). + * + * @param align + * The allocation's alignment. + * @param size + * The allocation's size. + * @return + * The allocation, or NULL on failure. + */ +void *xmemalign(size_t align, size_t size); + /** * Process a yes/no prompt. * -- cgit v1.2.3