Slices and GC
BLM
blm768 at gmail.com
Thu Apr 5 08:00:03 PDT 2012
Recently I've been working on some projects that involve parsing
binary files. I've mainly been using std.file.read() to get the
whole file as a huge array and then extracting slices. I had
initially assumed that the GC would free any chunks of the array
that didn't end up being referenced by these slices, but after
reading some more, it looks like the whole array is kept in
memory even if only a few elements are actually referenced. Is
this actually the case? If so, might the language be extended to
handle this situation?
More information about the Digitalmars-d
mailing list