On 1/2/2011 9:26 AM, Sergey Senozhatsky wrote:
On (01/01/11 19:55), Arjan van de Ven wrote:
ok so I have applied all your other patches, but this one I want to
think about a little more.
the checks you add are valid, but I want to, before going down this
road, make up my mind on how memory allocation failures
should be handled, program wide.

your opinion (as well as others) is well appreciated;
I think we have two choices

1) on any allocation failure, just give up and exit
2) unwinder on all allocation failure paths, and struggle along.

right now, I'm leaning towards option 1), but I also feel bad about
it at the same time....
what do others think?

We can implement 1) by setting `out of memory' handler for operator new.
We can't do much in `of memory handler', because e.g. writing to std::cerr
or things like that may lead to addition internal memory allocations (ostream
buffering) which could fail as well.

We also could do something like slab allocations. Or we can take a look how
e.g. git developers are dealing with the out-of-memory problem.

ok I like this approach... simple and global.
I'll apply this patch shortly...



_______________________________________________
Discuss mailing list
[email protected]
http://lists.lesswatts.org/listinfo/discuss

Reply via email to