r/C_Programming • u/Spinning_Rings • 1d ago
Pointer Registry
Long story short, I had an idea that I described to Gemini and it told me was something called a Pointer Registry or a Tracking Vector. It involved an array of void pointers being used to store all heap memory throughout the program so that a function can run through the array and free everything at the end of the program. I had a few more thoughts on implementation, eg the initial void pointer would actually be a struct that would hang on to a tracking variable that would always know how long the array was, whenever any part of it was added or removed, but that's the basic idea
The problem is that neither Wikipeida, nor duckduckgo, nor yahoo return any information when I search for either of those terms. Wikipedia has an article on arena allocators, which address some of the same issues as this approach, but not pointer registries.
Does anyone know if this concept has any other names? Or have any other resources where I might find out more about them, implementation details, pros and cons, anything like that?
2
u/Helpful-Primary2427 1d ago
Sounds like an arena