5 ms·
And all of them know how much memory they've allocated.
by adrianmonk 9y ago
And all of them know how much memory they've allocated.
- MarceColl 9y agoYes, but unless you expose at the language level an interface for all types of allocators and enforce it then a whole lot of allocation techniques like memory pools couldn't be used with strcpy or would have to use char* type of strings again. The point is not that allocators don't know how much memory has been allocated, but that C has no idea about the underlying allocator, so it cannot ask it about the length of the string as it was proposed.