ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "nobu (Nobuyoshi Nakada)" <nobu@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:57571] [CommonRuby - Feature #8568] Introduce RbConfig value for native word size, to avoid Fixnum#size use
Date: Wed, 2 Oct 2013 09:52:53 +0900	[thread overview]
Message-ID: <redmine.journal-42187.20131002095253@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-8568.20130625061413@ruby-lang.org


Issue #8568 has been updated by nobu (Nobuyoshi Nakada).


They are extracted from configure.in script automatically.
And ANSI/ISO C standard requires stringize operator to turn the argument into a string literal *before* expanding it.
----------------------------------------
Feature #8568: Introduce RbConfig value for native word size, to avoid Fixnum#size use
https://bugs.ruby-lang.org/issues/8568#change-42187

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/

  parent reply	other threads:[~2013-10-02  1:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 21:14 [ruby-core:55638] [CommonRuby - Feature #8568][Open] Introduce RbConfig value for native word size, to avoid Fixnum#size use headius (Charles Nutter)
2013-06-25  2:01 ` [ruby-core:55641] [CommonRuby - Feature #8568] " nobu (Nobuyoshi Nakada)
2013-06-25  3:50 ` [ruby-core:55642] " headius (Charles Nutter)
2013-06-25  5:05 ` [ruby-core:55643] " nobu (Nobuyoshi Nakada)
2013-06-25 10:48 ` [ruby-core:55647] " naruse (Yui NARUSE)
2013-06-25 11:16 ` [ruby-core:55648] Re: [CommonRuby - Feature #8568][Open] " Tanaka Akira
2013-07-03  7:56 ` [ruby-core:55773] [CommonRuby - Feature #8568] " nobu (Nobuyoshi Nakada)
2013-07-03  9:46   ` [ruby-core:55775] " Tanaka Akira
2013-07-03  8:03 ` [ruby-core:55774] " nobu (Nobuyoshi Nakada)
2013-09-27 10:45 ` [ruby-core:57425] " headius (Charles Nutter)
2013-10-01  0:40 ` [ruby-core:57509] " headius (Charles Nutter)
2013-10-01  0:59 ` [ruby-core:57513] [CommonRuby - Feature #8568][Closed] " nobu (Nobuyoshi Nakada)
2013-10-01 18:16 ` [ruby-core:57557] [CommonRuby - Feature #8568] " headius (Charles Nutter)
2013-10-02  0:52 ` nobu (Nobuyoshi Nakada) [this message]
2013-10-02  5:32 ` [ruby-core:57588] " headius (Charles Nutter)
2013-10-02 17:05 ` [ruby-core:57607] " nobu (Nobuyoshi Nakada)
2013-10-02 18:38 ` [ruby-core:57615] " headius (Charles Nutter)
2013-10-02 18:54 ` [ruby-core:57616] " nobu (Nobuyoshi Nakada)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-42187.20131002095253@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).