[Bf-committers] Some words about a strange thing named
Jean-Luc Peurière
jlp at nerim.net
Fri Nov 25 11:42:48 CET 2005
Le 25 nov. 05 à 10:47, Jonathan Merritt a écrit :
> This is a valid point, but the more important question is:
>
> "So, we check for NULL, and then do... ? What, exactly?"
>
> IMHO, a NULL return should typically be handled at a high level by
> the malloc() wrapper. I mean, what can Blender *do* if it can't
> access any more memory? Some suggestions:
> 1. Empty caches, and then try again.
> 2. Give up, try to save and quit (storing a "run out of memory"
> flag in the memory manager to prevent recursion).
> 3. (...)?
> These things should surely be implemented in a high-level memory
> manager, not peppered throughout the code in every function that
> allocates memory. Does anyone disagree?
hmm. on all current systems, when malloc fails, it means you have run
out of *BOTH* physical and swap memory.
At this point the system is likely unusable because locked in a swap
freenzy. you can recover from that only by killing the app
trying to save data is an open door for corruption of them.
Now, a smart strategy of clearing caches and such would be useful
when running out of physical memory (no swap involved) but that is
an entirely different problem
lukep
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.blender.org/pipermail/bf-committers/attachments/20051125/57d3fa64/attachment.htm
More information about the Bf-committers
mailing list