mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
fixing valgrind issues, injecting garbage collector inside vulkan's funtions
This commit is contained in:
@@ -9,6 +9,7 @@ namespace mlx
|
||||
MemManager();
|
||||
|
||||
static void* Malloc(std::size_t size);
|
||||
static void* AlignedMalloc(std::size_t alignment, std::size_t size);
|
||||
static void* Calloc(std::size_t n, std::size_t size);
|
||||
static void* Realloc(void* ptr, std::size_t size);
|
||||
static void Free(void* ptr);
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace mlx
|
||||
|
||||
void FontRegistry::Reset()
|
||||
{
|
||||
for(auto& font: m_fonts_registry)
|
||||
font->Destroy();
|
||||
m_fonts_registry.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,10 +67,14 @@
|
||||
#include <math.h> // sincos
|
||||
#endif
|
||||
|
||||
#include <Core/Memory.h>
|
||||
|
||||
#define VMA_STATIC_VULKAN_FUNCTIONS 0
|
||||
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
|
||||
#define VMA_VULKAN_VERSION 1000000
|
||||
#define VMA_ASSERT(expr) ((void)0) // Because why not
|
||||
#define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (mlx::MemManager::AlignedMalloc(alignment, size))
|
||||
#define VMA_SYSTEM_ALIGNED_FREE(ptr) (mlx::MemManager::Free(ptr))
|
||||
#define VMA_ASSERT_LEAK(expr) ((void)0) // Because why not
|
||||
|
||||
#ifdef MLX_COMPILER_CLANG
|
||||
#pragma clang diagnostic push
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace mlx
|
||||
public:
|
||||
GPUAllocator() = default;
|
||||
|
||||
void Init() noexcept;
|
||||
void Init(const VkAllocationCallbacks* callbacks) noexcept;
|
||||
void Destroy() noexcept;
|
||||
|
||||
VmaAllocation CreateBuffer(const VkBufferCreateInfo* binfo, const VmaAllocationCreateInfo* vinfo, VkBuffer& buffer, const char* name = nullptr) noexcept;
|
||||
|
||||
Reference in New Issue
Block a user