James Harris wrote:
Quote:
Gene <gene.ress...@gmail.comwrote:
>
|
.... snip ...
Quote:
> Quote:
>Garbage collectors deal with this when they need to increase the
>pool size when not much VM is left. There isn't a single best
>policy because behavior depends heavily on the OS.
| >
Agreed. The more I think about this the less I think there is any
kind of one-size-fits-all solution. One advantage of distributing
as source code is that people can vary the code to suit their
situation. I've kept the original code as it was but have
documented some alternatives as comments within the code.
|
In general you should adjust the mechanism to fit the expected
use. As an example, my ggets routine expands the buffer in
constant increments (of 128), because its primary use is expected
to be interactive input, and those strings are not normally
unlimited. However my hashlib expands its table by a factor of two
each time, resulting in constant average overhead, and basically
eliminating consideration of table size. In each case there are
possible penalties.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.