R
Ralph Shnelvar
Florian,
FG> The thing is that an Array of size (300_000*20) already has as many
FG> slots for references. So it's not "initializing references". It just
FG> makes every field of the Array referencing that one BigNum. There is
FG> no allocation or initialization happening in this step.
There has to be initialization, doesn't there?
irb(main):001:0> a=Array.new(10)
=> [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
irb(main):002:0> a[5]
=> nil
FG> The thing is that an Array of size (300_000*20) already has as many
FG> slots for references. So it's not "initializing references". It just
FG> makes every field of the Array referencing that one BigNum. There is
FG> no allocation or initialization happening in this step.
There has to be initialization, doesn't there?
irb(main):001:0> a=Array.new(10)
=> [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
irb(main):002:0> a[5]
=> nil