diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-05-02 11:28:06 +0200 |
---|---|---|
committer | Lars Kanis <lars@greiz-reinsdorf.de> | 2023-05-02 11:54:33 +0200 |
commit | 08b1a6754fb1ebbf340c778e9a015ce0ecc83974 (patch) | |
tree | 5011a6b04cb9295bd2d6c44ed302a0bfb0d3acaf /spec/ffi/managed_struct_spec.rb | |
parent | 98cce6a671e333fcb6b6eeeb821885f03d0e2fa5 (diff) | |
download | ffi-08b1a6754fb1ebbf340c778e9a015ce0ecc83974.tar.gz |
Allow private release method for ManagedStruct and AutoPointer
FFI users might not want to expose `release` as a public class method, but want to keep it private.
Also re-enable GC tests that were disabled as part of #427, but make them opt-in per env var FFI_TEST_GC.
Derivations of Releaser are no longer necessary, so that they are removed now.
Diffstat (limited to 'spec/ffi/managed_struct_spec.rb')
-rw-r--r-- | spec/ffi/managed_struct_spec.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/ffi/managed_struct_spec.rb b/spec/ffi/managed_struct_spec.rb index b4e80bb..6299bdc 100644 --- a/spec/ffi/managed_struct_spec.rb +++ b/spec/ffi/managed_struct_spec.rb @@ -46,6 +46,8 @@ describe "Managed Struct" do def self.release(_ptr) @@count += 1 end + private_class_method :release + def self.wait_gc(count) loop = 5 while loop > 0 && @@count < count |