This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Micro-optimisation in <ext/rope.h> ?
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 9 Dec 2014 15:19:32 +0000
- Subject: Micro-optimisation in <ext/rope.h> ?
- Authentication-results: sourceware.org; auth=none
What's this for?
#ifdef __EXCEPTIONS
_Rope_self_destruct_ptr() : _M_ptr(0) { };
#else
_Rope_self_destruct_ptr() { };
#endif
Are we really just trying to avoid setting a pointer to zero for the
case where the object won't get destroyed by stack-unwinding?
<ext/ropeimpl.h> seems to do the same:
#if !defined(__GC) && defined(__EXCEPTIONS)
__forest[__i] = 0;
#endif
In the interests of simplicity I think we should just zero those
pointers even when exceptions are disabled. And the default
constructor could just be removed, it isn't used anywhere!
I'll try to remember to come back to this in stage1 next year.