Re: Advantage of uthash over glib2 hash?
Ben Martin <[email protected]>
| Newsgroups | gmane.comp.fonts.fontforge.devel |
|---|---|
| Message-ID | <1406429453.6633.188.camel@sam> |
On Sat, 2014-07-26 at 09:16 -0500, Frank Trampe wrote: > I needed a quick hash in order to solve a big performance problem. uthash > was simple (not quite so much as the front page on its website suggests), > well documented, easy to implement, and compatibly licensed. And I knew > that Troy would help me if I had a problem. (There were no problems.) I was > very happy with the way it turned out. GLib can be a bit heavy and > difficult to use in certain cases since it brings with it so much baggage, > and, to be honest, I didn't know that it implemented hashes anyway. Personally I like STL and boost multi indexed collections. But glib2 seems like a very common collections API if you are just using plain C. > > That said, I'm perfectly satisfied with GLib doing what it currently does. > I know that a few other people would like to switch to GNUlib where > possible, but I don't think that this is worth the effort and trouble right > now. I added a task so I don't forget that translating over to glib2 for dlists might be a good idea. https://github.com/fontforge/fontforge/issues/1576 I don't really mind what collections APIs are used. The hope is that if many developers are already familiar with glib2 ones then it lowers the barrier to them doing some hacking on FontForge, if only by a little bit. One other area that glib2 does nice things is in main loop integration. Handing monitoring file descriptors, timeouts and such. I have added some of this to FontForge using custom code, though that also brings limitations and folks are not familiar with the API. Of course, cleaning up and converting over the mainloop code opens the path for some subtle bugs and hangs on some platforms that the custom code at the moment can handle. ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds