News for hackers. Stuff that matters.
Re:A Defer Mechanism for C by gpderetta on Monday December 14, 2020 @10:34AM (#25418690)
> RAII doesn't help with a generic pair of init and deinit functions, such as malloc() and free() for example,

people have been writing RAII scope_exit classes for at least 20 years to do exactly this.

> You can't do anything with RAII unless you wrap your stuff into objects which just forces the OO crap on everything regardless of whether it's a good fit for the OO paradigm.

wrapping something in an object does not make it OO. For example there is nothing object oriented about std::unique_ptr.

Re:A Defer Mechanism for C by saagarjha on Monday December 14, 2020 @02:13PM (#25421821)
Well, you can only wrap objects in one, although you can "wrap" a primitive by writing lambdas for this purpose.