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()
914
914
}
915
915
916
916
// 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
917
945
MONO_API void mono_unity_gc_enable ()
918
946
{
919
947
#if HAVE_BOEHM_GC
@@ -923,6 +951,7 @@ MONO_API void mono_unity_gc_enable()
923
951
#endif
924
952
}
925
953
954
+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
926
955
MONO_API void mono_unity_gc_disable ()
927
956
{
928
957
#if HAVE_BOEHM_GC
@@ -932,6 +961,7 @@ MONO_API void mono_unity_gc_disable()
932
961
#endif
933
962
}
934
963
964
+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
935
965
MONO_API int mono_unity_gc_is_disabled ()
936
966
{
937
967
#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();
152
152
MONO_API void mono_unity_install_unitytls_interface (unitytls_interface_struct * callbacks );
153
153
154
154
// 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
155
165
MONO_API void mono_unity_gc_enable ();
166
+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
156
167
MONO_API void mono_unity_gc_disable ();
168
+ // Deprecated. Remove when Unity has switched to mono_unity_gc_set_mode
157
169
MONO_API int mono_unity_gc_is_disabled ();
158
170
171
+
159
172
//misc
160
173
MonoAssembly * mono_unity_assembly_get_mscorlib ();
161
174
MonoImage * mono_unity_image_get_mscorlib ();
You can’t perform that action at this time.
0 commit comments