Re: Slices and array appending

2012-10-22 Thread cal
On Monday, 22 October 2012 at 04:59:41 UTC, Jonathan M Davis wrote: Blocks of memory are allocated and freed as a whole. When an array is forced to be reallocated, then a new block of memory is allocated for it, and any existing slices continue to refer to the original block of memory. The

Slices and array appending

2012-10-21 Thread cal
Just want to make sure I understand this properly: I have a large dynamic array (whose elements are immutable) which only ever grows. I also have a whole lot of small slices into this array, the slices never change, and they don't span the entire contents of the array (they are just pieces).

Re: Slices and array appending

2012-10-21 Thread Era Scarecrow
On Sunday, 21 October 2012 at 23:35:30 UTC, cal wrote: Just want to make sure I understand this properly: I have a large dynamic array (whose elements are immutable) which only ever grows. I also have a whole lot of small slices into this array, the slices never change, and they don't span

Re: Slices and array appending

2012-10-21 Thread Jonathan M Davis
On Monday, October 22, 2012 01:35:29 cal wrote: Just want to make sure I understand this properly: I have a large dynamic array (whose elements are immutable) which only ever grows. I also have a whole lot of small slices into this array, the slices never change, and they don't span the