From 9ac224eb2699d528f7c3544861f02a5255605f4f Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 24 Apr 2010 14:41:22 +0000 Subject: * lib/pp.rb: use [""].pack("p").size to detect the pointer size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/pp.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lib/pp.rb') diff --git a/lib/pp.rb b/lib/pp.rb index 2fcb4af820..cda282448b 100644 --- a/lib/pp.rb +++ b/lib/pp.rb @@ -164,13 +164,7 @@ class PP < PrettyPrint group(1, '#<' + obj.class.name, '>', &block) end - if 0x100000000.class == Bignum - # 32bit - PointerMask = 0xffffffff - else - # 64bit - PointerMask = 0xffffffffffffffff - end + PointerMask = (1 << ([""].pack("p").size * 8)) - 1 case Object.new.inspect when /\A\#\z/ -- cgit v1.2.3