[#9722] Kernel#system broken inside Dir.chdir(&block) if system command doesn't have shell characters — <noreply@...>

Bugs item #7278, was opened at 2006-12-14 13:59

8 messages 2006/12/14

[#9749] System V IPC in standard library? — Steven Jenkins <steven.jenkins@...>

Back in August, I needed a semaphore to serialize access to an external

14 messages 2006/12/19

[#9753] CVS freeze — SASADA Koichi <ko1@...>

Hi,

20 messages 2006/12/20
[#9755] Re: [ruby-dev:30039] CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

[#9757] Re: [ruby-dev:30040] Re: CVS freeze — SASADA Koichi <ko1@...> 2006/12/20

Hi,

Re: Where to start

From: dreamhead <dreamhead.cn@...>
Date: 2006-12-31 03:30:47 UTC
List: ruby-core #9811
Because VALUE is NOT just a POINTER, such as Fixnum.
In Ruby, Fixnum is stored as long, not a pointer.

In modern machine, pointer should be aligned, so the last two bits of
the pointer should be 0. So the VALUE whose the last two bits is not 0
could be used in other places.

Fixnum set the last bit to 1, so you can see the following code in Ruby.h
#define FIXNUM_FLAG 0x01
#define INT2FIX(i) ((VALUE)(((long)(i))<<1 | FIXNUM_FLAG))
#define FIXNUM_P(f) (((long)(f))&FIXNUM_FLAG)

The cost for creating a fixnum is very low, so there's no need to
maintain integer object cache like in Python and Java to improve
performance.

The above is just an example for VALUE. In Ruby, nil, true, false,
symbol are all special VALUE.

You can get more information from RHG.

2006/12/30, Strong Cypher <cypherstrong@gmail.com>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> a think not easy in this language it's the original doc, japan so ...
> I hope a fully english version will be available soon, it could be more easy
> for helping
>
> But thx for that, effectivly it sould be a pointer
>
> why don't call it POINTER so ??? hihi
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32) - WinPT 1.0.1
>
> iD8DBQFFlidFEg3iyspSWPARArXWAJsHHH2CfGxe3Q4BcJNb2ek3qjccdACfa1HS
> apXd0Lsj38lYwT/6O9Sv5ic=
> =mSrI
> -----END PGP SIGNATURE-----
>
>


-- 
Everything is simple!

In This Thread

Prev Next