Inconsistent handling of 32 vs 64 bits
--------------------------------------
Key: JRUBY-1864
URL: http://jira.codehaus.org/browse/JRUBY-1864
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.x
Environment: Latest JRuby 1.1b1
Reporter: Vladimir Sizikov
It would be great if JRuby could handle 32/64bit issue consistently. So that:
1. FixNums are 32bit as with any other 32 bit implementation.
2. Boundary between FixNum/BigNums are the same as for 32bit MRI.
3. 1.size should be 4, not 8.
Currently, in JRuby we have sort of mixture between 32bit and 64bit. FixNums
are 64bit, but sprintf/pack/unpack assume that we have 32bit implementation.
But 1.size is as in 64bit implementation.
This is a source of constant spec related issues, as was seen is the past:
JRUBY-1588, JRUBY-1587.
And also we have a new spec failure for String#modulo:
1)
String#% supports unsigned formats using %u FAILED
Expected "..4294967291" to equal "..18446744073709551611":
./mspec/expectations.rb:10:in `fail_with'
./mspec/matchers/base.rb:8:in `=='
/opt/work/rubinius/./spec/ruby/1.8/core/string/modulo_spec.rb:472:in `=='
/opt/work/rubinius/./spec/ruby/1.8/core/string/modulo_spec.rb:471:in
`platform_is'
/opt/work/rubinius/./spec/ruby/1.8/core/string/modulo_spec.rb:471:in
`platform_is'
/opt/work/rubinius/./spec/ruby/1.8/core/string/modulo_spec.rb:471:in `call'
./mspec/runner/runner.rb:136:in `describe'
./mspec/runner/runner.rb:135:in `each'
./mspec/runner/runner.rb:130:in `describe'
./mspec/runner/runner.rb:135:in `describe'
/opt/work/rubinius/./spec/ruby/1.8/core/string/modulo_spec.rb:4:in `describe'
/opt/work/rubinius/./spec/ruby/1.8/core/string/modulo_spec.rb:4:in `load'
tmp/last_mspec.rb:15:in `load'
tmp/last_mspec.rb:10:in `each'
tmp/last_mspec.rb:10:in `each'
The reason for the failure is that JRuby is detected as 64bit implementation
(1.size is 8 after all), but the results JRuby returns from String#% are 32 bit
ones.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email