#ifndef MRT_OBJECT_MANAGER_H
#define MRT_OBJECT_MANAGER_H
#include "ObjectModel/MArray.h"
#include "ObjectModel/MClass.h"
#include "ObjectModel/MObject.h"
namespace MapleRuntime {
class ObjectManager {
public:
enum class ArrayElemBits : U32 { ELEM_8B = 8, ELEM_16B = 16, ELEM_32B = 32, ELEM_64B = 64 };
void Init() const {};
void Fini() const {};
static inline ObjRef NewObject(const TypeInfo* ti, MSize size, AllocType allocType = AllocType::MOVEABLE_OBJECT);
static inline ObjRef NewWeakRefObject(const TypeInfo* ti, MSize size,
AllocType allocType = AllocType::MOVEABLE_OBJECT);
static inline ObjRef NewPinnedObject(const TypeInfo* ti, MSize size, bool isFinalizer);
static inline ObjRef NewFinalizer(const TypeInfo* ti, MSize size);
static inline GCTib GetGCInfo(const TypeInfo* ti);
static inline ArrayRef NewArray(MIndex nElems, const TypeInfo* arrayTi,
AllocType allocType = AllocType::MOVEABLE_OBJECT);
static inline ArrayRef NewObjArray(MIndex nElems, const TypeInfo* arrayTi,
AllocType allocType = AllocType::MOVEABLE_OBJECT);
static inline ArrayRef NewKnownWidthArray(MIndex nElems, const TypeInfo* arrayTi, ArrayElemBits elemBits,
AllocType allocType = AllocType::MOVEABLE_OBJECT);
};
}
#endif