Skip to content

Commit dc58c2b

Browse files
committed
Add mono_gc_is_incremental
1 parent d063d2b commit dc58c2b

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

mono/metadata/boehm-gc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,17 +420,23 @@ mono_gc_get_heap_size (void)
420420
}
421421

422422
int64_t
423-
mono_get_max_time_slice_ns()
423+
mono_gc_get_max_time_slice_ns()
424424
{
425425
return GC_get_time_limit() * 1000000;
426426
}
427427

428428
void
429-
mono_set_max_time_slice_ns(int64_t maxTimeSlice)
429+
mono_gc_set_max_time_slice_ns(int64_t maxTimeSlice)
430430
{
431431
GC_set_time_limit(maxTimeSlice / 1000000);
432432
}
433433

434+
MonoBoolean
435+
mono_gc_is_incremental()
436+
{
437+
return GC_is_incremental_mode();
438+
}
439+
434440
gboolean
435441
mono_gc_is_gc_thread (void)
436442
{

mono/metadata/mono-gc.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ MONO_API int mono_gc_get_generation (MonoObject *object);
109109
MONO_API int mono_gc_collection_count (int generation);
110110
MONO_API int64_t mono_gc_get_used_size (void);
111111
MONO_API int64_t mono_gc_get_heap_size (void);
112-
MONO_API int64_t mono_get_max_time_slice_ns ();
113-
MONO_API void mono_set_max_time_slice_ns (int64_t maxTimeSlice);
112+
MONO_API int64_t mono_gc_get_max_time_slice_ns ();
113+
MONO_API void mono_gc_set_max_time_slice_ns (int64_t maxTimeSlice);
114114
MONO_API MonoBoolean mono_gc_pending_finalizers (void);
115+
MONO_API MonoBoolean mono_gc_is_incremental (void);
115116
MONO_API void mono_gc_finalize_notify (void);
116117
MONO_API int mono_gc_invoke_finalizers (void);
117118
/* heap walking is only valid in the pre-stop-world event callback */

mono/metadata/null-gc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,22 @@ mono_gc_get_heap_size (void)
9292
}
9393

9494
int64_t
95-
mono_get_max_time_slice_ns()
95+
mono_gc_get_max_time_slice_ns()
9696
{
9797
return 0;
9898
}
9999

100100
void
101-
mono_set_max_time_slice_ns(int64_t maxTimeSlice)
101+
mono_gc_set_max_time_slice_ns(int64_t maxTimeSlice)
102102
{
103103
}
104104

105+
MonoBoolean
106+
mono_gc_is_incremental()
107+
{
108+
return FALSE;
109+
}
110+
105111
gboolean
106112
mono_gc_is_gc_thread (void)
107113
{

mono/metadata/sgen-mono.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,13 +2832,19 @@ mono_gc_get_heap_size (void)
28322832
}
28332833

28342834
int64_t
2835-
mono_get_max_time_slice_ns()
2835+
mono_gc_get_max_time_slice_ns()
28362836
{
28372837
return 0;
28382838
}
28392839

2840+
MonoBoolean
2841+
mono_gc_is_incremental()
2842+
{
2843+
return FALSE;
2844+
}
2845+
28402846
void
2841-
mono_set_max_time_slice_ns(int64_t maxTimeSlice)
2847+
mono_gc_set_max_time_slice_ns(int64_t maxTimeSlice)
28422848
{
28432849
}
28442850

0 commit comments

Comments
 (0)