back to arays

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Thu May 18 06:27:12 PDT 2006


Derek Parnell wrote:
> On Wed, 17 May 2006 22:07:12 -0700, Unknown W. Brackets wrote:
> 
>> I should note, currently, DMD's implementation won't move anything 
>> you're pointing to.
> 
> Even if the length is increased beyond the size that has been allocated for
> a dynamic array? I thought that DMD allocated a new block of the right size
> and copied data from the old block to it then released the old block back
> to the GC.
>  

Yes, that's what it does, but that resizing results from an explicit 
programmer action, and not from the GC. When W. Brackets mentioned 
"DMD's implementation" I believe he meant the GC only, which, as is 
known, indeed doesn't currently move anything.

> I think that if the length is decreased then no copying goes on and that no
> memory is released back to the GC, but can be later reused if the length
> then is increased anywhere up to the original allocation size.
> 


-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d-learn mailing list