Files
godot/thirdparty/meshoptimizer/allocator.cpp
T
Jakub Marcowski 5672bfd78d meshoptimizer: Update to 1.1.1
(cherry picked from commit f2b42696965815c7d1de1c4303b25e7b5d0ea7b8)
2026-06-30 09:15:12 -05:00

22 lines
607 B
C++

// This file is part of meshoptimizer library; see meshoptimizer.h for version/license details
#include "meshoptimizer.h"
#include <assert.h>
#ifdef MESHOPTIMIZER_ALLOC_EXPORT
meshopt_Allocator::Storage& meshopt_Allocator::storage()
{
static Storage s = {::operator new, ::operator delete };
return s;
}
#endif
void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV* allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV* deallocate)(void*))
{
assert(allocate && deallocate);
meshopt_Allocator::Storage& s = meshopt_Allocator::storage();
s.allocate = allocate;
s.deallocate = deallocate;
}