Add test support for types and objects creation
* test_support::TypeInfoHolder to create TypeInfo given payload description * test_support::Object<Payload> to create objects with Payload and to get them from ObjHeader* after checking that their type_info are layout compatible. * test_support::*Array<Count> to create various arrays with given length and similarly get them from ArrayHeader*.
This commit is contained in:
committed by
Space
parent
aff49c76a9
commit
f51c85a63f
@@ -116,6 +116,11 @@ extern "C" void RestoreMemory(MemoryState*) {
|
||||
// TODO: Remove when legacy MM is gone.
|
||||
}
|
||||
|
||||
extern "C" void ClearMemoryForTests(MemoryState* state) {
|
||||
auto* threadData = FromMemoryState(state)->Get();
|
||||
threadData->ClearForTests();
|
||||
}
|
||||
|
||||
extern "C" RUNTIME_NOTHROW OBJ_GETTER(AllocInstance, const TypeInfo* typeInfo) {
|
||||
auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData();
|
||||
RETURN_RESULT_OF(mm::AllocateObject, threadData, typeInfo);
|
||||
|
||||
Reference in New Issue
Block a user