Skip to content

Commit 1dc319a

Browse files
Implement rb_gc_impl_during_gc_p
1 parent 36c6bbc commit 1dc319a

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

gc/mmtk/mmtk.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,7 @@ rb_gc_impl_start(void *objspace_ptr, bool full_mark, bool immediate_mark, bool i
561561
bool
562562
rb_gc_impl_during_gc_p(void *objspace_ptr)
563563
{
564-
// TODO
565-
return false;
564+
return mmtk_gc_in_progress_p();
566565
}
567566

568567
static void

gc/mmtk/mmtk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ void mmtk_set_gc_enabled(bool enable);
100100

101101
bool mmtk_gc_enabled_p(void);
102102

103+
bool mmtk_gc_in_progress_p(void);
104+
103105
MMTk_Address mmtk_alloc(MMTk_Mutator *mutator,
104106
size_t size,
105107
size_t align,

gc/mmtk/src/api.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ pub extern "C" fn mmtk_gc_enabled_p() -> bool {
192192
crate::CONFIGURATION.gc_enabled.load(Ordering::Relaxed)
193193
}
194194

195+
#[no_mangle]
196+
pub extern "C" fn mmtk_gc_in_progress_p() -> bool {
197+
crate::mmtk().gc_in_progress()
198+
}
199+
195200
// =============== Object allocation ===============
196201

197202
#[no_mangle]

0 commit comments

Comments
 (0)