News for hackers. Stuff that matters.
Re:Checked C: extension to C that adds static and dynamic ch... by adrianmonk on Thursday March 15, 2018 @01:30AM (#16590606)
And all of them know how much memory they've allocated.
Re:Checked C: extension to C that adds static and dynamic ch... by MarceColl on Thursday March 15, 2018 @04:26AM (#16591173)
Yes, 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.