Dear SDCC users,

do any of you use malloc (0)? Do you rely on the current behavior?

There are two valid approches to malloc(0) - the implementation might not support allocating 0 bytes, and just return null, just as if it failed for lack of memory. Or we do allocate a little bit of space, and return a non-null pointer, that can be safely passed to free later.

SDCC malloc currently always returns null for attempts to allocate 0 bytes. I'm considering changing that.

Philipp



_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to