This isn't really a big deal, but let's just propagate allocation errors as std::bad_alloc exceptions.