Skip to content

Commit

Permalink
* lib/pp.rb: use [""].pack("p").size to detect the pointer size.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Apr 24, 2010
1 parent 0e5546d commit 9ac224e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Sat Apr 24 23:40:50 2010 Tanaka Akira <[email protected]>

* lib/pp.rb: use [""].pack("p").size to detect the pointer size.

Sat Apr 24 21:07:27 2010 Tanaka Akira <[email protected]>

* test/psych/test_psych.rb: don't leave temporary files.
Expand Down
8 changes: 1 addition & 7 deletions lib/pp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,7 @@ def object_group(obj, &block) # :yield:
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\#<Object:0x([0-9a-f]+)>\z/
Expand Down

0 comments on commit 9ac224e

Please sign in to comment.