This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Micro-optimisation in <ext/rope.h> ?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]