module Rubellite::GC

Overview

Coordinates garbage collection between Crystal's Boehm GC and Ruby's mark-sweep GC.

Defined in:

rubellite/gc.cr

Class Method Summary

Class Method Detail

def self.pin(obj : Object) : UInt64 #

Pins a Crystal object so Boehm GC will not collect it while Ruby holds a reference.


[View source]
def self.register_address(val_ptr : Pointer(LibRuby::Value)) : Nil #

Registers a Ruby VALUE address with the Ruby GC root set


[View source]
def self.start_ruby_gc : Nil #

Explicitly triggers Ruby GC cycle


[View source]
def self.unpin(id : UInt64) : Nil #

Unpins a Crystal object when Ruby's GC finalizes the wrapper.


[View source]
def self.unregister_address(val_ptr : Pointer(LibRuby::Value)) : Nil #

Unregisters a Ruby VALUE address from the Ruby GC root set


[View source]