3 ms·
No, I simply am using a different approach, still in C, where strings are simple char*, null-terminated, nothing hidden with magic fields above the base address
by stephc_int13 4y ago
No, I simply am using a different approach, still in C, where strings are simple char*, null-terminated, nothing hidden with magic fields above the base address of the string.
The trick is to pass an allocator (or container) to string handling functions.
If/when I want to get rid of all the garbage I reset the container/allocator.
- klodolph 4y agoYeah, you should have just said that in the first place. I’ve seen similar approaches, e.g. with APR pools, and if your application can work within those restrictions, it’s very convenient.