On Thursday, 14 July 2016 at 09:29:10 UTC, Jonathan M Davis wrote:
On Thursday, July 14, 2016 07:20:46 cym13 via
Digitalmars-d-learn wrote:
[...]
Whatever the profiler is telling you, it's clearly not actually
telling you whether an allocation took place, and that's easy
to test. For instanc
On Thursday, July 14, 2016 07:20:46 cym13 via Digitalmars-d-learn wrote:
> As one can see there seem to be absolutely no difference in
> allocations wether we reserve or not. I've ran more experiences,
> reserving way less or more than I appened to no avail:
> allocations seem to just ignore it.
>
Does changing the capacity of dynamic arrays actually do anything
with respect to memory allocation? I have the following data with
DMD 2.071.1
// With dmd -profile=gc
void main() {
import std.stdio;
int[] arr = [1, 1, 1];
arr.reserve(512);
foreach (i ; 0..10)
arr ~=