buffered input
Steven Schveighoffer
schveiguy at yahoo.com
Mon Feb 7 04:57:51 PST 2011
On Sun, 06 Feb 2011 10:25:15 -0500, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> How does the stream decide between 1 and 2? Clearly it's undesirable to
> grow the buffer too much and it's also undesirable to copy too much
> data. A simple approach is to establish a bound on losses, for example
> copy data only if size to copy is < 5% of the entire buffer.
I think also, you should test to see if appending will copy the data
anyways (i.e. reallocate). We may need to add a runtime function for this.
-Steve
More information about the Digitalmars-d
mailing list