是否有一个64位的Ruby? [英] Is there a 64-bit Ruby?

查看:219
本文介绍了是否有一个64位的Ruby?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

人们似乎正在编制MRI红宝石(1.8.7)的64位平台。我一直在寻找,现在读了一段时间,而没有真正得到我想要的答案。如果你们中的任何人实际上比内存在Ruby中使用4GB以上我想知道的是?红宝石是真正的64位,如果你编译它呀?

It seems like people are compiling MRI Ruby (1.8.7) for 64-bit platforms. I've been searching and reading for a while now without really getting the answers I want. What I want to know is if any of you guys actually used more than 4GB of memory in Ruby? Is Ruby truly 64-bits if you compile it that way?

我发现在源$ C ​​$ C意见表明它不是64位的测试。比如它说的的BigDecimal尚未被编译并在64位整数的系统测试。的为<一个评论href="http://www.sfr-fresh.com/unix/misc/ruby-1.8.7-p174.tar.gz%3Aa/ruby-1.8.7-p174/ext/bigdecimal/bigdecimal%5Fen.html#STRUCT"相对=nofollow> BigDecimal的。

I've found comments in the source code indicating that it's not tested on 64-bits. For instance it says "BigDecimal has not yet been compiled and tested on 64 bit integer system." in the comments for BigDecimal.

这也将是有趣的了解Ruby的其他实现怎么办在64位。

It would also be interesting to know how the other implementations of Ruby do in 64-bits.

推荐答案

MRI(既1.8.x的1.9.x的和线)可以被编译为64位。

MRI (both the 1.8.x and 1.9.x line) can be compiled as 64 bits.

例如,雪豹捆绑了1.8.7编译为64位。这可以,例如 42.size 出现在活动监视器,或者从 IRB 问。你会得到8(字节),如果它被编译在64位,4(字节),否则。

For example, Snow Leopard comes bundled with 1.8.7 compiled as 64 bits. This can be seen in the activity monitor, or from irb by asking, for example 42.size. You'll get 8 (bytes) if it is compiled in 64 bits, 4 (bytes) otherwise.

红宝石将能够访问RAM超过4G。例如:

Ruby will be able to access over 4G of ram. For example:

$ irb
>> n = (1 << 29) + 8
=> 536870920
>> x = Array.new(n, 42); x.size
=> 536870921  # one greater because it holds elements from 0 to n inclusive

获取最后一行将需要一段时间,如果你没有超过4个G或RAM,因为操作系统会掉很多,但即使在我的机器有4 GB它的工作原理。虚拟内存大小的进程为4.02 -G。

Getting the last line will take a while if you don't have more than 4 G or ram because the OS will swap a lot, but even on my machine with 4 GB it works. Virtual ram size for the process was 4.02 G.

我更新了其已经过时的BigDecimal的HTML文件的注释(从2003年3月...)

I updated the comment in the bigdecimal html file which was outdated (from march 2003...)

这篇关于是否有一个64位的Ruby?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆