Merge branch 'object_array_marshalling' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-object_array_marshalling

This commit is contained in:
Wojtek Figat
2023-05-10 09:22:22 +02:00
9 changed files with 108 additions and 30 deletions

View File

@@ -869,6 +869,13 @@ void MCore::GC::WriteArrayRef(MArray* dst, MObject* ref, int32 index)
mono_gc_wbarrier_set_arrayref(dst, (byte*)ptr + index * sizeof(void*), ref);
}
void MCore::GC::WriteArrayRef(MArray* dst, Span<MObject*> refs)
{
void* ptr = mono_array_addr_with_size(dst, 0, 0);
for (int32 index = 0; index < refs.Length(); index++)
mono_gc_wbarrier_set_arrayref(dst, (byte*)ptr + index * sizeof(void*), refs[index]);
}
void MCore::Thread::Attach()
{
if (!IsInMainThread() && !mono_domain_get())