4 ms·
Maybe, maybe not. If your context has a list of things to free, it can also have a list of things to close. Or whatever you want. Many libraries do stuff lik
by sesuximo 6y ago
Maybe, maybe not.
If your context has a list of things to free, it can also have a list of things to close. Or whatever you want.
Many libraries do stuff like this and call the context creation/deletion lib_init/ lib_shutdown.
- asveikau 6y agoIt sounds an awful lot like such a context mechanism needs dynamic allocations. Something like the GNU cleanup attribute or a proposal like defer, or C++ RAII, can do that as a stack unwind, without the need for heap.
- sesuximo 6y agoThat would be the easiest way. Definitely a disadvantage