diff options
| author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-12-11 17:08:40 +0100 |
|---|---|---|
| committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-03-17 21:51:05 +0100 |
| commit | 0b814ea78d6b065e8e0785155207bd80b3d845c8 (patch) | |
| tree | 6513402706d55505ec57cf88c97db5633ffabb9a /modules/mono/mono_gd/gd_mono_utils.h | |
| parent | 989a223c5a6d6ba5b1b098be8983888cb49b2525 (diff) | |
| download | redot-engine-0b814ea78d6b065e8e0785155207bd80b3d845c8.tar.gz | |
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<MonoGCHandle>'; 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.
Diffstat (limited to 'modules/mono/mono_gd/gd_mono_utils.h')
| -rw-r--r-- | modules/mono/mono_gd/gd_mono_utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
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); |
