--e89a8f6474fd07b76d04caa01639
Content-Type: text/plain; charset=ISO-8859-1

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?.


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 <span dir="ltr">&lt;<a href="mailto:lists / ruby-forum.com" target="_blank">lists / ruby-forum.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

OK, but when i declare same array with my extension using a simple<br>
malloc() function. It takes very less time. Is there any internal<br>
mechanism goes on when Ruby creates an array by itself?.</blockquote><br>You&#39;re probably doing an inaccurate comparison. You&#39;re asking Ruby tollocate an array with 614,400,000 slots, which in C is equivalent to the same number of pointers, which depending on whether you&#39;re on a 32-bit or 64-bit host translates to either.4GB or 4.9GB.</div>

<div class="gmail_quote"><br></div><div class="gmail_quote">In general,&#39;d say the fact you&#39;re even attempting to do this is extremely suspect. What is your goal?</div><div class="gmail_quote"><br></div>-- <br>Tony Arcieri<br>

<br>

--e89a8f6474fd07b76d04caa01639--