Added inline to fix compilation in Clang 21 See https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/513, https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/pull/514
diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index e7ef463..6eba37a 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h
@@ -4290,7 +4290,7 @@ //////////////////////////////////////////////////////////////////////////////// // Memory allocation -static void* VmaMalloc(const VkAllocationCallbacks* pAllocationCallbacks, size_t size, size_t alignment) +static inline void* VmaMalloc(const VkAllocationCallbacks* pAllocationCallbacks, size_t size, size_t alignment) { void* result = VMA_NULL; if ((pAllocationCallbacks != VMA_NULL) && @@ -4310,7 +4310,7 @@ return result; } -static void VmaFree(const VkAllocationCallbacks* pAllocationCallbacks, void* ptr) +static inline void VmaFree(const VkAllocationCallbacks* pAllocationCallbacks, void* ptr) { if ((pAllocationCallbacks != VMA_NULL) && (pAllocationCallbacks->pfnFree != VMA_NULL)) @@ -10779,12 +10779,12 @@ #ifndef _VMA_MEMORY_FUNCTIONS -static void* VmaMalloc(VmaAllocator hAllocator, size_t size, size_t alignment) +static inline void* VmaMalloc(VmaAllocator hAllocator, size_t size, size_t alignment) { return VmaMalloc(&hAllocator->m_AllocationCallbacks, size, alignment); } -static void VmaFree(VmaAllocator hAllocator, void* ptr) +static inline void VmaFree(VmaAllocator hAllocator, void* ptr) { VmaFree(&hAllocator->m_AllocationCallbacks, ptr); }