I'm trying to debug my c extension (https://github.com/rgeo/rgeo), and am currently improving handling of compaction (a nice video introducing that topic), and I'd like to have informations about when the GC is running.
So far I found one solutions to see how many times the GC has run:
GC::Profiler.enable
at_exit { GC::Profiler.report }
However I'd rather gather information when the GC runs directly, not by waiting for the end of my program.
I found that gc.c has a gc_report method that would do the trick, however it looks like I have to recompile ruby to work with that one.
Isn't there a simple way to enable GC events reporting? Note that I'm using rbenv on a macos, if that may help.