Monthly Archives: December 2012

Compiling with checks and assertions

Some people like to complain about g_return_if_fail() and g_assert() being left in when compiling release executables and libraries. I have learned that it can actually have a positive effect on performance, as it can start pre-fetching that data into cache-lines. To get the performance I lost by compiling with -DG_DISABLE_ASSERT and -DG_DISABLE_CHECKS I had to [...]

Data Structures: Trie

Over the holidays I often enjoy learning a new data-structure by implementing it. This year is no different, and so I implemented a Trie (pronounced “try”).
http://en.wikipedia.org/wiki/Trie
TL;DR

trie.c
trie.h

What is a Trie?

A Trie is a tree structure where each node of the tree contains a single character from an inserted string key. The first character of the string [...]

Manpages

A friend of mine said they had the perception that GNOME technologies appeared unfinished due to the nature that manpages were not installed for the APIs. While I didn’t particularly agree with that sentiment, I did decide I would make manpages for them.
The gnome-manpages can be found here.
The resulting manpages look very similar to what [...]

GNOME University @ FOSDEM ‘13?

Is anyone interested in a GNOME University meetup while at FOSDEM ‘13? Leave a comment if you are so I can get an idea of how many.
I would imagine we could use that time for asking questions, guidance, individual help regarding your free software projects and what not. jhbuild also seems to be a common [...]

bloom filters

Everyone seems to be talking about bloom filters the last couple of years. So last night I implemented one to see what all the rage was about. I’m sure you can find better implementations, but you can find it at https://github.com/chergert/bloom-glib/blob/master/bloom-filter.h.
Also, if you want the opposite of a bloom filter, (direct-mapped cache), you can find [...]

PSA: Testing GObject Lifecycles

It’s a good idea to test that the lifecycle of your object is what you expect when writing your unit tests with GTest (and I hope you do). Here is a quick way to do that.
static voidmy_object_test (void){ MyObject *obj = my_object_new(); /* play with obj */ [...]