TIL that std::shared_ptr has a custom "deleter" function you can set for actually deleting the memory. Seems to make for a pretty nice way to create a memory buffer manager. I need to shuffle a lot of smallish buffers and allocating/freeing memory all the time is not particularly efficient, especially not when time is essential. I guess this is nothing new to the veterans out there, but it'll make my life easier.
[#]cpp #std #shared_ptr
=> More informations about this toot | View the thread | More toots from chakie@toot.community
=> View cpp tag | View std tag | View shared_ptr tag This content has been proxied by September (ba2dc).Proxy Information
text/gemini