File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -914,6 +914,34 @@ mono_unity_get_unitytls_interface()
914914}
915915
916916// gc
917+ MONO_API void mono_unity_gc_set_mode (MonoGCMode mode )
918+ {
919+ #if HAVE_BDWGC_GC
920+ switch (mode )
921+ {
922+ case MONO_GC_MODE_ENABLED :
923+ if (GC_is_disabled ())
924+ GC_enable ();
925+ GC_set_disable_automatic_collection (FALSE);
926+ break ;
927+
928+ case MONO_GC_MODE_DISABLED :
929+ if (!GC_is_disabled ())
930+ GC_disable ();
931+ break ;
932+
933+ case MONO_GC_MODE_MANUAL :
934+ if (GC_is_disabled ())
935+ GC_enable ();
936+ GC_set_disable_automatic_collection (TRUE);
937+ break ;
938+ }
939+ #else
940+ g_assert_not_reached ();
941+ #endif
942+ }
943+
944+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
917945MONO_API void mono_unity_gc_enable ()
918946{
919947#if HAVE_BOEHM_GC
@@ -923,6 +951,7 @@ MONO_API void mono_unity_gc_enable()
923951#endif
924952}
925953
954+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
926955MONO_API void mono_unity_gc_disable ()
927956{
928957#if HAVE_BOEHM_GC
@@ -932,6 +961,7 @@ MONO_API void mono_unity_gc_disable()
932961#endif
933962}
934963
964+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
935965MONO_API int mono_unity_gc_is_disabled ()
936966{
937967#if HAVE_BOEHM_GC
Original file line number Diff line number Diff line change @@ -152,10 +152,23 @@ MONO_API unitytls_interface_struct* mono_unity_get_unitytls_interface();
152152MONO_API void mono_unity_install_unitytls_interface (unitytls_interface_struct * callbacks );
153153
154154// gc
155+ typedef enum
156+ {
157+ MONO_GC_MODE_DISABLED = 0 ,
158+ MONO_GC_MODE_ENABLED = 1 ,
159+ MONO_GC_MODE_MANUAL = 2
160+ } MonoGCMode ;
161+
162+ MONO_API void mono_unity_gc_set_mode (MonoGCMode mode );
163+
164+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
155165MONO_API void mono_unity_gc_enable ();
166+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
156167MONO_API void mono_unity_gc_disable ();
168+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
157169MONO_API int mono_unity_gc_is_disabled ();
158170
171+
159172//misc
160173MonoAssembly * mono_unity_assembly_get_mscorlib ();
161174MonoImage * mono_unity_image_get_mscorlib ();
You can’t perform that action at this time.
0 commit comments