Files
RedHotRoast-ios/HybridCLRData/LocalIl2CppData-OSXEditor/il2cpp/libil2cpp/hybridclr/metadata/MetadataPool.h
T

34 lines
689 B
C++
Raw Normal View History

2026-07-17 14:03:00 +08:00
#pragma once
#include "../CommonDef.h"
#include "metadata/GenericMetadata.h"
#include "vm/MetadataAlloc.h"
namespace hybridclr
{
namespace metadata
{
template<typename T>
T* MetadataMallocT()
{
return (T*)HYBRIDCLR_METADATA_MALLOC(sizeof(T));
}
template<typename T>
T* MetadataCallocT(size_t count)
{
return (T*)HYBRIDCLR_METADATA_CALLOC(count, sizeof(T));
}
class MetadataPool
{
public:
static void Initialize();
static const Il2CppType* GetPooledIl2CppType(const Il2CppType& type);
static Il2CppType* ShallowCloneIl2CppType(const Il2CppType* type);
static const Il2CppArrayType* GetPooledIl2CppArrayType(const Il2CppType* elementType, uint32_t rank);
};
}
}