Created
July 13, 2025 15:58
-
-
Save fenrir-naru/22fea70438da83bec92f7468bc5a4a67 to your computer and use it in GitHub Desktop.
Access Ractor::Selector by calling C API without Ruby build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if true then | |
# Fiddle version | |
require 'fiddle' | |
module Fiddle | |
Function.new(dlopen(nil).sym('rb_init_ractor_selector'), [], TYPE_VOID).call | |
end | |
else | |
# FFI version | |
require 'ffi' | |
Module::new{ | |
extend FFI::Library | |
ffi_lib FFI::CURRENT_PROCESS | |
attach_function :rb_init_ractor_selector, [], :void | |
}::rb_init_ractor_selector | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment