From 0b814ea78d6b065e8e0785155207bd80b3d845c8 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Wed, 11 Dec 2019 17:08:40 +0100 Subject: Mono/C#: Optimize the way we store GC handles for scripts Don't store GC handles for C# script instances and instance bindings as 'Ref'; store the raw data instead. Initially this was not possible as we needed to store a Variant, but this had not been the case for a looong time yet the stored type was never updated. --- modules/mono/mono_gd/gd_mono_utils.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/mono/mono_gd/gd_mono_utils.h') diff --git a/modules/mono/mono_gd/gd_mono_utils.h b/modules/mono/mono_gd/gd_mono_utils.h index 7b7afc44e0..fd02907d87 100644 --- a/modules/mono/mono_gd/gd_mono_utils.h +++ b/modules/mono/mono_gd/gd_mono_utils.h @@ -92,6 +92,11 @@ _FORCE_INLINE_ bool is_main_thread() { return mono_domain_get() != NULL && mono_thread_get_main() == mono_thread_current(); } +uint32_t new_strong_gchandle(MonoObject *p_object); +uint32_t new_strong_gchandle_pinned(MonoObject *p_object); +uint32_t new_weak_gchandle(MonoObject *p_object); +void free_gchandle(uint32_t p_gchandle); + void runtime_object_init(MonoObject *p_this_obj, GDMonoClass *p_class, MonoException **r_exc = NULL); bool mono_delegate_equal(MonoDelegate *p_a, MonoDelegate *p_b); -- cgit v1.2.3