4 ms·
I never had the use case to allocate 0 bytes of memory. If I would allocate 0 bytes of memory and get a pointer to it, I wouldn't care what the value of the po
by randomNumber7 1y ago
I never had the use case to allocate 0 bytes of memory.
If I would allocate 0 bytes of memory and get a pointer to it, I wouldn't care what the value of the pointer is since I am not allowed to dereference it anyways.
But then again, why would I allocate 0 bytes of memory?
- bobmcnamara 1y agoSometimes it shakes out simpler for a generic container. Ex: a vector using only a counter and pointer - you can use realloc() with fewer pointer validity checks.
- corysama 1y agoSome folks used it as a per-run, internal GUID generator. Not saying that's a good use. But, it was done.