C
CBFalconer
Richard said:CBFalconer said:
.... snip ...
Okay, here are the issues as I see them:
1) the function doesn't allow the user to minimise memory
management issues by re-using existing buffers.
2) the function doesn't allow the user to resist
denial-of-memory attacks.
3) the function doesn't allow the user to specify whether the
buffer should be resized to fit.
4) the function documentation doesn't mention any of these
problems.
5) in Usenet articles where you recommend ggets, you don't
mention any of these problems.
Now how does that differ from use of malloc, calloc, or realloc?
For example, any program (or routine) that collects data will
malloc something and add it to a list, tree, or something. Sooner
or later that will overflow, and jam the malloc system. If the
program doesn't free that memory, but continues, the
denial-of=memory works. Same here. Note that the ggets caller
knows why the function returned.
I covered your complaint about lack of explanation with ggets.h
extract. It is hard to use the system without the .h file.