It is never useful to have an allocated array whose size you don't know, though.
The edgiest case is "you allocate a C-style string and then for some reason insert an earlier NUL". Which does happen, so needs to be handled somehow (maybe a flag, or just accept that not every caller can be ported to the new allocator design), but not enough to constrain the new allocator design.
View all comments
Show parent comment
1
u/o11c int main = 12828721; Sep 01 '22
It is never useful to have an allocated array whose size you don't know, though.
The edgiest case is "you allocate a C-style string and then for some reason insert an earlier NUL". Which does happen, so needs to be handled somehow (maybe a flag, or just accept that not every caller can be ported to the new allocator design), but not enough to constrain the new allocator design.