diff --git a/lib/osx_ruby_ld_helpers.rb b/lib/osx_ruby_ld_helpers.rb index 79a77739c1..4b227d2e26 100644 --- a/lib/osx_ruby_ld_helpers.rb +++ b/lib/osx_ruby_ld_helpers.rb @@ -13,7 +13,7 @@ module OSXRubyDLHelpers end def malloc(size) - if ruby_1_9_or_higher? + if defined?(DL::CPtr) DL::CPtr.malloc(size) else DL::malloc(size)