3 ms·
I think this is the main culprit of the libc string functions, you have to provide buffers to store results, and the responsibility of managing those individual
by stephc_int13 4y ago
I think this is the main culprit of the libc string functions, you have to provide buffers to store results, and the responsibility of managing those individually can be annoying, and bug prone, resulting in vulnerabilities.
Passing an allocator (like Zig) or a container (like in my framework) to anything that needs to allocate some memory to store a result is both explicit, low overhead and quite convenient in practice.
- bandrami 4y agoNote that they're annoying, bug prone, and vulnerable in 3rd-party memory managed libraries, too, but you can just say it's someone else's problem then.