module FFI::Library

def freeze

No further methods or variables can be attached and no further enums or typedefs can be created in this module afterwards.
This freezes the module's definitions, so that it can be used in a Ractor.

Freeze all definitions of the module
def freeze
  instance_variables.each do |name|
    var = instance_variable_get(name)
    FFI.make_shareable(var)
  end
  nil
end