diff options
Diffstat (limited to 'include/zix/allocator.h')
-rw-r--r-- | include/zix/allocator.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/zix/allocator.h b/include/zix/allocator.h index 619697e..bace039 100644 --- a/include/zix/allocator.h +++ b/include/zix/allocator.h @@ -108,6 +108,7 @@ ZixAllocator* ZIX_NONNULL zix_default_allocator(void); /// Convenience wrapper that defers to malloc() if allocator is null +ZIX_MALLOC_FUNC static inline void* ZIX_ALLOCATED zix_malloc(ZixAllocator* const ZIX_NULLABLE allocator, const size_t size) { @@ -117,6 +118,7 @@ zix_malloc(ZixAllocator* const ZIX_NULLABLE allocator, const size_t size) } /// Convenience wrapper that defers to calloc() if allocator is null +ZIX_MALLOC_FUNC static inline void* ZIX_ALLOCATED zix_calloc(ZixAllocator* const ZIX_NULLABLE allocator, const size_t nmemb, @@ -128,6 +130,7 @@ zix_calloc(ZixAllocator* const ZIX_NULLABLE allocator, } /// Convenience wrapper that defers to realloc() if allocator is null +ZIX_NODISCARD static inline void* ZIX_ALLOCATED zix_realloc(ZixAllocator* const ZIX_NULLABLE allocator, void* const ZIX_NULLABLE ptr, @@ -149,6 +152,7 @@ zix_free(ZixAllocator* const ZIX_NULLABLE allocator, } /// Convenience wrapper that defers to the system allocator if allocator is null +ZIX_MALLOC_FUNC static inline void* ZIX_ALLOCATED zix_aligned_alloc(ZixAllocator* const ZIX_NULLABLE allocator, const size_t alignment, |