Friday, January 25, 2008

More fun and games

As is to be expected, I have been spending a fair amount of time working on the address book rewrite recently. Recent developments start with the triumphant announcement that my WIP no longer leaks. Kudos to dbaron for his creation of the leak-fixing screencast that enabled me to find the two problems that were causing leaks. Interestingly enough, leaking just one object seems to quickly leak gobs more objects; my strings were all being leaked from a leaking property bag. Only 8 leaks seem to remain: 3 of nsILocalFile, 3 of nsStringBuffer (related?), and 1 nsVoidArray. I touched neither arrays nor files in my WIP, so these leaks are probably not my fault.

My next announcement is a loathing of mork that I had previously not thought possible. The number of calls needed to construct an iterative property bag was at first off-putting. Then came the annoyances of yarns: some yarn functions manage the initialization themselves, others except the user to do so. Of course, the documentation doesn't distinguish between these two types. Finally, there seems to a bug in mork that omits the first cell in a cursor iteration. My complaints are duly noted in comments in my patch.

Announcement number 3 is a kudos to Taras Glek and his Dehydra GCC. It's magic! After spending an afternoon in working with me to get it working (note: disabling GCC's bootstrap helps cut down on build times), I finally got it working to the point where I discovered that it didn't handle virtual functions too well. He got that working this morning (!!!), and so now I generated a listing of every place where the deprecated attributes on nsIAbCard are used in C++ files in mailnews. All 487 of them, all but about 100 of which are located in nsAbCardProperty or nsAddrDatabase.

Also today, I tested out Neil's --disable-static-mail option for Thunderbird, and it works fine enough, so that should become the default for debug builds soon. It also makes building much easier; I should now try and get that into my automagic build script for mozilla.

Update:

The address book refactoring now passes all four address book tests.

No comments: