MetadataAlloc.h 898 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #include "il2cpp-runtime-stats.h"
  4. struct Il2CppGenericClass;
  5. struct Il2CppGenericMethod;
  6. namespace il2cpp
  7. {
  8. namespace vm
  9. {
  10. void MetadataAllocInitialize();
  11. void MetadataAllocCleanup();
  12. // These allocators assume the g_MetadataLock lock is held
  13. //[WL] Calloc will memset allocated memroy to zero, Malloc will not!
  14. void* MetadataMalloc(size_t size, Il2CppMemStat label);
  15. void* MetadataCalloc(size_t count, size_t size, Il2CppMemStat label);
  16. // These metadata structures have their own locks, since they do lightweight initialization
  17. Il2CppGenericClass* MetadataAllocGenericClass();
  18. Il2CppGenericMethod* MetadataAllocGenericMethod();
  19. std::size_t MetadataTotalMemSize();
  20. #if IL2CPP_ENABLE_MEM_STATS
  21. std::size_t mem_stats_get_metadata_free();
  22. #endif //IL2CPP_ENABLE_MEM_STATS
  23. } // namespace vm
  24. } // namespace il2cpp