|
From: Bob F. <bfr...@si...> - 2004-06-27 18:35:30
|
On Sun, 27 Jun 2004, Nicholas Nethercote wrote: > Hi, > > Currently, for tools replacing malloc (eg. Memcheck), if a malloc call fails, > Valgrind aborts. (Actually, an assertion failure occurs.) > > I figure that client calls to malloc should fail and return 0 like the system > malloc in this case. That's what happens with tools that don't replace the > system malloc (eg. Nulgrind). Does anyone object to this proposed behaviour? Software exists (including software I maintain) which is capable of carrying on with an alternative algorithm (e.g. disk-based) when certain large malloc requests fail so I second the motion that malloc should return zero. It would be wise to log that malloc did fail, along with the requested allocation size. Bob ====================================== Bob Friesenhahn bfr...@si... http://www.simplesystems.org/users/bfriesen |