C Coding Tip - Self-Manage Memory Alllocation
An anonymous reader inputs: "The C programming language defines two standard memory management functions: malloc() and free(). C programmers frequently use those functions to allocate buffers at run time to pass data between functions. In many situations, however, you cannot predetermine the actual sizes required for the buffers, which may cause several fundamental problems for constructing complex C programs. This article advocates a self-managing, abstract data buffer. It outlines a pseudo-C implementation of the abstract buffer and details the advantages of adopting this mechanism."
1) The guy that published that on the web must be either pretty desperate or some pointy-haired boss with a little background and I wonder which is that?
2) This kind of stuff is coded on a daily basis everywhere with an advantage that it's usually tailored to needs of particular app. And if you don't like coding it, hey, there is a bunch of ready to use libraries on every occasion - regular, threads, IPC, whatever... That's why people take those "Data Structures" classes in the school.
3) If you still have problems, switch to C++ or better Java and forget all those malloc/free things. If you can't get it to work, work with something you can get to work.
I'm sorry, but this is just about as complicated as an elementary data structures assignment. Wow, an arbitrary size memory buffer with an underlying linked list. Hot shit!