| 1 | // This file is part of meshoptimizer library; see meshoptimizer.h for version/license details |
| 2 | #include "meshoptimizer.h" |
| 3 | |
| 4 | #ifdef MESHOPTIMIZER_ALLOC_EXPORT |
| 5 | meshopt_Allocator::Storage& meshopt_Allocator::storage() |
| 6 | { |
| 7 | static Storage s = {::operator new, ::operator delete }; |
| 8 | return s; |
| 9 | } |
| 10 | #endif |
| 11 | |
| 12 | void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV* allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV* deallocate)(void*)) |
| 13 | { |
| 14 | meshopt_Allocator::Storage& s = meshopt_Allocator::storage(); |
| 15 | s.allocate = allocate; |
| 16 | s.deallocate = deallocate; |
| 17 | } |