summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/ffi-1.17.2-arm64-darwin/samples/hello_ractor.rb
blob: 904fe8544d10f3cd247e0d35a50a01861bd002fa (plain)
1
2
3
4
5
6
7
8
9
10
11
require 'ffi'

module Foo
  extend FFI::Library
  ffi_lib FFI::Library::LIBC
  attach_function("cputs", "puts", [ :string ], :int)
  freeze
end
Ractor.new do
  Foo.cputs("Hello, World via libc puts using FFI in a Ractor")
end.take