Ozlabs.org

<October 2004>
Su Mo Tu We Th Fr Sa
         
           

Chris's Random Ramblings

Tue, 05 Oct 2004 - Book space galore Had a very productive long weekend and I think I've now tripled the amount of bookshelf space in my house. My house turned into a bit of a workshop during the week, but everything is now cleaned up and I can start unpacking some of the boxes of books I have in the cupboards. While I was away at work during the week my parents also put up a small shed in my backyard. At last, I no longer have to store my lawnmower in the spare room :-)
Tue, 05 Oct 2004 - More junk Tridge's junkcode area contains more useful code than most people's non junk collections. The website itself is run on one of the programs, tserver. Its a tiny webserver which supports server side scripting - in bash! A recent addition, which Tridge showed me today, is talloc, a hierarchical memory allocator library.

talloc allows you to create hierarchies of memory allocation, and then when freeing a parent, having all the child nodes also freed automatically. It also allows you to attach arbitrary destructors to nodes which are run when the memory is freed. One example of using a destructor is to close file descriptors. These features allow you to remove a lot of complicated or cluttering error paths from your program without leaking resources. It brings to C some features of C++. Appealing to those who have a strong dislike of programming in C++. Next on the list may even be exception handling.