Is there a C++ library that implements a linked list with all the memory on the stack?
Yes I know there will be an upper limit but looking for functionality to search it, add and delete items.
Is there a C++ library that implements a linked list with all the memory on the stack?
Yes I know there will be an upper limit but looking for functionality to search it, add and delete items.
Ok, so typically, when you hook/replace the memory alloocator, the method is to add X bytes (it's best if it's a multiple of the normal alignment, so 16 or 32 bytes in the common case) to the actual allocation, and in that store whatever information is required. Typically, you store a pointer to the "previous" allocation in this extra memory, so you can later on walk that list and examine for example what the caller is and produce some sort of histogram or "top 10 biggest users", or whatever it may be.
You can't really use stack for what you want, since you are (I presume) returning from the call to the allocation function before you are done with the information you need, so storing the data on the stack seems unreasonable.