Re:The Horror in the Standard Library
by naasking on Saturday May 06, 2017 @09:47AM
(#14280208)
> That'd be silly. Among many other problems, it would mean you can't do things like take a substring of a const buffer via pointer arithmetic, because you'd need to add a header in the middle
Right, and now you understand why free should have always accepted a size parameter, just like malloc.
Re:The Horror in the Standard Library
by asveikau on Saturday May 06, 2017 @10:47AM
(#14280460)
No, I don't. Doing zero-copy substrings of a read only buffer and an allocator chopping up a writable buffer into multiple chunks are very different scenarios.
Right, and now you understand why free should have always accepted a size parameter, just like malloc.