DMD 1.001 release
    Walter Bright 
    newshound at digitalmars.com
       
    Wed Jan 24 00:05:01 PST 2007
    
    
  
Tomas Lindquist Olsen wrote:
> std.zlib is not doing this correctly.
I should look at that.
> which also makes me think about how to handle this case properly:
> 
> void[] dst = new void[1024];
> dst.length = dst.length + 1024;
> dst.length = dst.length + 1024;
> dst.length = dst.length + 1024;
> dst.length = dst.length + 1024;
> dst.length = dst.length + 1024;
> 
> assuming one of these calls have to relocate how would I be sure that I
> inform the GC properly?
Inform it with the last one.
> A call to the GC in the end would obviously do, but what if you want to
> make sure the GC doesn't scan the array while it's still being resized?
Depends on what data you put in it.
> While I'm at it I have been wondering why we can't have:
> 
> void[1024] sa;
> 
> when
> 
> void[] da = new void[1024];
> 
> is perfectly fine.
You're probably right.
    
    
More information about the Digitalmars-d-announce
mailing list