MarshalAlloc.h 738 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #if _DEBUG
  4. #include <map>
  5. #include "os/Mutex.h"
  6. #endif
  7. namespace il2cpp
  8. {
  9. namespace vm
  10. {
  11. class LIBIL2CPP_CODEGEN_API MarshalAlloc
  12. {
  13. public:
  14. static void* Allocate(size_t size);
  15. static void* ReAlloc(void* ptr, size_t size);
  16. static void Free(void* ptr);
  17. static void* AllocateHGlobal(size_t size);
  18. static void* ReAllocHGlobal(void* ptr, size_t size);
  19. static void FreeHGlobal(void* ptr);
  20. #if _DEBUG
  21. static void PushAllocationFrame();
  22. static void PopAllocationFrame();
  23. static bool HasUnfreedAllocations();
  24. static void ClearAllTrackedAllocations();
  25. #endif
  26. };
  27. } /* namespace vm */
  28. } /* namespace il2cpp */