4 ms·
Can someone explain the magic sauce that makes this work?
by rileymat 12y ago
Can someone explain the magic sauce that makes this work?
- Snaipe 12y agoI pretty much explain all that in the article[1], but here is the gist of it: * I implemented smalloc and sfree to respectively allocate and deallocate a memory block with prepended metadata * I use a GNU variable attribute called cleanup to run sfree when the variable goes out of scope * I made some macros to have some syntactic sugar on top of that [1] - http://snaipe.me/c/c-smart-pointers/ http://snaipe.me/c/c-smart-pointers/
- rileymat 12y agoThanks, the link I was clicking went straight to the Github repo. Did not see the article.