From: Tony Arcieri Date: 2012-09-27T04:47:02+09:00 Subject: Re: Array Creation --e89a8f6474fd07b76d04caa01639 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Sep 26, 2012 at 1:32 PM, Tridib Bandopadhyay wrote: > OK, but when i declare same array with my extension using a simple > malloc() function. It takes very less time. Is there any internal > mechanism goes on when Ruby creates an array by itself?. You're probably doing an inaccurate comparison. You're asking Ruby to allocate an array with 614,400,000 slots, which in C is equivalent to the same number of pointers, which depending on whether you're on a 32-bit or 64-bit host translates to either 2.4GB or 4.9GB. In general, I'd say the fact you're even attempting to do this is extremely suspect. What is your goal? -- Tony Arcieri --e89a8f6474fd07b76d04caa01639 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Sep 26, 2012 at 1:32 PM, Tridib Bandopadhyay <= lists@ruby-forum.= com> wrote:
OK, but when i declare same array with my extension using a simple
malloc() function. It takes very less time. Is there any internal
mechanism goes on when Ruby creates an array by itself?.

Yo= u're probably doing an inaccurate comparison. You're asking Ruby to= allocate an array with 614,400,000 slots, which in C is equivalent to the = same number of pointers, which depending on whether you're on a 32-bit = or 64-bit host translates to either=A02.4GB or 4.9GB.

In general,= I'd say the fact you're even attempting to do this is extremely su= spect. What is your goal?

--
= Tony Arcieri

--e89a8f6474fd07b76d04caa01639--