Do you use D's GC?

jfondren julian.fondren at gmail.com
Tue Aug 3 18:21:31 UTC 2021


On Tuesday, 3 August 2021 at 18:18:48 UTC, Steven Schveighoffer 
wrote:
> It's no different for length setting:
>
> ```d
> buffer = new int[100];
> auto buffer2 = buffer;
> buffer.length = 50;
> buffer.length = 51; // must reallocate
> buffer[$-1] = 10;
> ```

All of the buffer-stomping "must reallocate" cases are preserved 
in the rewrite that only assigns buffer.length when the new value 
is larger. The cases that were omitted, that were a performance 
drain, were same-length or less-length assignments.



More information about the Digitalmars-d mailing list