Cleaning/Releasing large arrays from memory

rikki cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 24 07:51:04 PDT 2017


Stuff the GC.
You don't need it to care about collecting (or destroying for that matter).

Tell it to free[0] the array directly.

```D
T[] array;

GC.free(array.ptr);
```

Normally I would suggest to create your own buffer, but because of the 
DB library probably doesn't support that, no point trying to force it.

[0] http://dlang.org/phobos/core_memory.html#.GC.free


More information about the Digitalmars-d-learn mailing list