Skip to content

Commit 7da4b7f

Browse files
Implement rb_gc_impl_during_gc_p
1 parent 06a053f commit 7da4b7f

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
@@ -515,8 +515,7 @@ rb_gc_impl_start(void *objspace_ptr, bool full_mark, bool immediate_mark, bool i
515515
bool
516516
rb_gc_impl_during_gc_p(void *objspace_ptr)
517517
{
518-
// TODO
519-
return false;
518+
return mmtk_gc_in_progress_p();
520519
}
521520

522521
static void

gc/mmtk/mmtk.h

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

100100
bool mmtk_gc_enabled_p(void);
101101

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

gc/mmtk/src/api.rs

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

210+
#[no_mangle]
211+
pub extern "C" fn mmtk_gc_in_progress_p() -> bool {
212+
crate::mmtk().gc_in_progress()
213+
}
214+
210215
// =============== Object allocation ===============
211216

212217
#[no_mangle]

0 commit comments

Comments
 (0)