Skip to content

Category Archives: Uncategorized

compiler-enforced locked accesses


If you’ve done any amount of threaded programming, you’ve probably run across code that looked like: // Only accessed with the mutex held. uint32_t mFlags; bool mConnected; nsTArray<int32_t> mData; // Only called with the mutex held. void DoSomething(); Perhaps you’ve even gotten to debug code which inadvertently violated the locking requirements of the members. Several […]

standardizing things my way


I was reading The Digital Doctor: Hope, Hype, and Harm at the Dawn of Medicine’s Computer Age and ran across a passage that resonated: Everybody, of course, supports standardization—in theory. But human beings (particularly, but not exclusively, famous Harvard professors practicing at famous Boston hospitals) want things to be standardized their way. The difficulty that […]

explicit is better than implicit: c++ implicitly defined member functions


In the tradition of The Zen of Python, I’ve been thinking about pushing for explicit declarations of otherwise implicitly-defined member functions in C++, both in code that I write and in code that I review: // Instances of this class should not be copied. MyClass(const MyClass&) = delete; MyClass& operator=(const MyClass&) = delete; // We […]

white space as unused advertising space


I picked up Matthew Crawford’s The World Outside Your Head this weekend. The introduction, subtitled “Attention as a Cultural Problem”, opens with these words: The idea of writing this book gained strength one day when I swiped my bank card to pay for groceries. I watched the screen intently, waiting for it to prompt me […]

recent tsan improvements for firefox


One of my goals for Q2 was to make Firefox usable with “modern” (version 3.6+) clang. For reasons previously unknown, Firefox would only work with relatively old clang (version ~3.3); indeed, our wiki page for TSan recommends checking out specific SVN versions! I’m happy to say that goal has been met.  If you like, you […]

on development speedbumps


Last week, I ran into a small speedbump with my development process. I normally write my patches and commit them to git with initial lines that look like: fix IPDL thinko for never-inline method declarations; r=bent Then, when I use git-bz to push my patches to bugzilla, it autofills the r? flag for the patch […]

tsan bug finding update


At the beginning of Q1, I set a goal to investigate races with Thread Sanitizer and to fix the “top” 10 races discovered with the tool.  Ten races seemed like a conservative number; we didn’t know how many races there were, their impact, or how difficult fixing them would be.  We also weren’t sure how […]

measuring power usage with power gadget and joulemeter


In the continuing evaluation of how Firefox’s energy usage might be measured and improved, I looked at two programs, Microsoft Research’s Joulemeter and Intel’s Power Gadget. As you might expect, Joulemeter only works on Windows. Joulemeter is advertised as “a software tool that estimates the power consumption of your computer.” Estimates for the power usage […]

finding races in Firefox with ThreadSanitizer


We use a fair number of automated tools for memory errors (AddressSanitizer/Leak Sanitizer for use-after-free and buffer overflows; custom leak checking on refcounted objects; Valgrind tests and Julian Seward’s mochitests on Valgrind periodic testing), but we do very little in terms of checking for data races between threads.  As more and more components of the […]

multiple return values in C++


I’d like to think that I know a fair amount about C++, but I keep discovering new things on a weekly or daily basis.  One of my recent sources of new information is the presentations from CppCon 2014.  And the most recent presentation I’ve looked at is Herb Sutter’s Back to the Basics: Essentials of […]