On 12/01/09 15:08, Markus Armbruster wrote:
For what it's worth, it violates the spec for malloc(). For zero-sized allocations, we may either return a null pointer (but we already decided we don't want to), or an object different from any other object alive.
Which clearly rules out the fixed memory location for malloc(0)."malloc(size ? size : 1)" is indeed the easiest way to make sure we conform to the spec and also don't return NULL.
cheers, Gerd