From: Charles Hixson Date: 2012-11-14T16:20:03+09:00 Subject: Re: Extending Array instances Ryan Davis wrote: > On Nov 13, 2012, at 21:30 , Charles Hixson wrote: > >> FWIW, the answer I was looking for is that Arrays are automatically extended to the last index inserted into. This probably implies that Arrays use some sort of linked block index, though another possibility is that it just allocates a honking big chunk of memory, and does a copy whenever it needs to resize the array. This seems unlikely. Also silly. So I'll bet on a linked block index. > Welcome to silly... tho I'm not sure why you think that. That's not what the code I saw showed...admittedly my C skill are very poor. If it DOES do massive copying, I'm going to need a very different approach. And I'm not sure what would work. But why wouldn't Ruby use memory mapping? Copying a GB of memory around doesn't sound like a feasible approach, even though this would be done at full C speed. If that's true, then using a database is the only way I can think of that would work, and there are several reasons why I want to avoid that.