summaryrefslogtreecommitdiffstats
path: root/include/zix/allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/zix/allocator.h')
-rw-r--r--include/zix/allocator.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/zix/allocator.h b/include/zix/allocator.h
index bace039..6c9a61d 100644
--- a/include/zix/allocator.h
+++ b/include/zix/allocator.h
@@ -103,13 +103,11 @@ struct ZixAllocatorImpl {
};
/// Return the default allocator which simply uses the system allocator
-ZIX_CONST_API
-ZixAllocator* ZIX_NONNULL
+ZIX_CONST_API 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_FUNC static inline void* ZIX_ALLOCATED
zix_malloc(ZixAllocator* const ZIX_NULLABLE allocator, const size_t size)
{
ZixAllocator* const actual = allocator ? allocator : zix_default_allocator();
@@ -118,8 +116,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_MALLOC_FUNC static inline void* ZIX_ALLOCATED
zix_calloc(ZixAllocator* const ZIX_NULLABLE allocator,
const size_t nmemb,
const size_t size)
@@ -130,8 +127,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_NODISCARD static inline void* ZIX_ALLOCATED
zix_realloc(ZixAllocator* const ZIX_NULLABLE allocator,
void* const ZIX_NULLABLE ptr,
const size_t size)
@@ -152,8 +148,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_MALLOC_FUNC static inline void* ZIX_ALLOCATED
zix_aligned_alloc(ZixAllocator* const ZIX_NULLABLE allocator,
const size_t alignment,
const size_t size)