Re:Show HN
by lifthrasiir on Saturday December 03, 2022 @12:49PM
(#33845467)
Malloc is not a type. If you meant to say realloc, a good point and it's indeed a bad interface for the exact reason but still it's not a type.
[ Parent
| on HN ]
I believe malloc() was intended, as a number of old-school UNIX implementations of malloc() put the size of the allocation (and possibly other bookkeeping info?) "in front of" the pointer returned, in a similar way to how sds stores the size of its buffer.