From: "headius (Charles Nutter)" Date: 2013-10-03T03:38:01+09:00 Subject: [ruby-core:57615] [CommonRuby - Feature #8568] Introduce RbConfig value for native word size, to avoid Fixnum#size use Issue #8568 has been updated by headius (Charles Nutter). Ok...so hopefully we have tests for those names and we can consider them "spec". BTW, I'm asking because we'll want to provide the same SIZEOF hash in JRuby, and I need to know the names will be consistent and not change in the future. Thanks! ---------------------------------------- Feature #8568: Introduce RbConfig value for native word size, to avoid Fixnum#size use https://bugs.ruby-lang.org/issues/8568#change-42228 Author: headius (Charles Nutter) Status: Closed Priority: Normal Assignee: Category: Target version: Ruby 2.1.0 Fixnum#size is not really useful to represent native word size across all platforms and implementations. On JRuby, for example, our Fixnum is always represented as a 64-bit Java "long" value, regardless of the underlying native platform. There may be other implementations that fix Fixnum's size to a specific bit width as well. Therefore, using Fixnum#size to determine the size of a word on the underlying native platform is not reliable. I propose two additions to Ruby: 1. RbConfig value "word_size" for native word size. This could reflect bit size (32, 64) or byte size (4, 8). 2. A constant, somewhere in Ruby, to provide access to this value more directly. I'm not sure where this should go. ObjectSpace::WORD_SIZE? -- http://bugs.ruby-lang.org/