LWN.net Logo

talloc as an RAII alternatives in C

talloc as an RAII alternatives in C

Posted Dec 24, 2012 8:35 UTC (Mon) by scottt (subscriber, #5028)
In reply to: GNU sed 4.2.2 released; maintainer resigns by daglwn
Parent article: GNU sed 4.2.2 released; maintainer resigns

> You cannot do RAII in C. End of story.
Apache and Samba manage resource handles through apr_pool_t and talloc and they fair pretty well despite being written in C.


(Log in to post comments)

talloc as an RAII alternatives in C

Posted Dec 24, 2012 19:56 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link]

Nope. They don't have RAII, they have refcounted pools. It's about the best you can do in plain C.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds