From 56ec14c4369c591f5efbb500b0829b760bee7800 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 19 Dec 2022 18:14:21 -0500 Subject: Make allocator methods null-unspecified The required methods depend on the context (for example, a function might only need aligned_alloc and aligned_free), so unfortunately the nullability requirements can't be encoded in the type here. --- include/zix/allocator.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/zix/allocator.h b/include/zix/allocator.h index 5ab8bf8..a9064bb 100644 --- a/include/zix/allocator.h +++ b/include/zix/allocator.h @@ -96,12 +96,12 @@ typedef void (*ZixAlignedFreeFunc)( // /// Definition of ZixAllocator struct ZixAllocatorImpl { - ZixMallocFunc ZIX_NONNULL malloc; ///< Allocate - ZixCallocFunc ZIX_NONNULL calloc; ///< Allocate and zero - ZixReallocFunc ZIX_NONNULL realloc; ///< Reallocate - ZixFreeFunc ZIX_NONNULL free; ///< Free - ZixAlignedAllocFunc ZIX_NONNULL aligned_alloc; ///< Allocate aligned - ZixAlignedFreeFunc ZIX_NONNULL aligned_free; ///< Free aligned + ZixMallocFunc ZIX_UNSPECIFIED malloc; ///< Allocate + ZixCallocFunc ZIX_UNSPECIFIED calloc; ///< Allocate and zero + ZixReallocFunc ZIX_UNSPECIFIED realloc; ///< Reallocate + ZixFreeFunc ZIX_UNSPECIFIED free; ///< Free + ZixAlignedAllocFunc ZIX_UNSPECIFIED aligned_alloc; ///< Allocate aligned + ZixAlignedFreeFunc ZIX_UNSPECIFIED aligned_free; ///< Free aligned }; /// Return the default allocator which simply uses the system allocator -- cgit v1.2.1