allocator.cpp 552 B

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