Reply to Russell,
Walter Bright wrote:
I asked this over on stackoverflow.com to see what people using other
languages have to say, as well as the D community. The reason I ask
is to see if memory allocation can be allowed in functions marked
"nothrow".
http://stackoverflow.com/questions/333736/is-out-of-memory-a-recovera
ble-error
It seems that D has (or rather, can have) a trivial solution to this
problem. Allow programs to register with the GC when they have memory
which can be easily freed (caches and such). Then you can make "out
of memory" a non-recoverable error, since it only hits when we fail to
recover enough.
Some sort of higher level of granularity would be nice, mostly an ordering
hint re the different stages.
Seems to me that with this mechanism in place, we can treat
out-of-memory as an unrecoverable error.
Thoughts?
vote += 0.5; // nice idea, not sure it would help *me* in any way though.