Oddbean new post about | logout
 [$] realloc() and the oversize importance of zero-size objects

Small objects can lead to large email threads.  In this
case, the GNU C Library (glibc) community has been having an extensive
debate over the handling of zero-byte allocations.  Specifically, what
should happen when a program calls https://man7.org/linux/man-pages/man3/malloc.3.html

specifying a size of zero?  This is, it seems, a topic about which some
people, at least, have strong feelings.

https://lwn.net/Articles/995196/