From: Roland McGrath Date: Wed, 30 Sep 2009 23:15:29 +0000 (-0700) Subject: Add clear method to subr::sharing_stack. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7912c5385e224e5c993d08584eb5c22d5f9a341b;p=thirdparty%2Felfutils.git Add clear method to subr::sharing_stack. --- diff --git a/libdw/ChangeLog b/libdw/ChangeLog index e6546ee1a..498e6ef32 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,5 +1,7 @@ 2009-09-30 Roland McGrath + * c++/subr.hh (subr::sharing_stack::clear): New method. + * c++/values.cc (dwarf::attr_value::what_space): Grok exprloc, flag_present, sec_offset. diff --git a/libdw/c++/subr.hh b/libdw/c++/subr.hh index 921a79727..79e1c7559 100644 --- a/libdw/c++/subr.hh +++ b/libdw/c++/subr.hh @@ -1184,15 +1184,19 @@ namespace elfutils _m_size = n; } - inline void fini () + public: + inline void clear () { if (_m_head == NULL) assert (_m_size == 0); else - _m_head->release (); + { + _m_head->release (); + _m_head = NULL; + _m_size = 0; + } } - public: inline bool empty () const { return _m_head == NULL; @@ -1254,14 +1258,14 @@ namespace elfutils inline ~sharing_stack () { - fini (); + clear (); } inline sharing_stack &operator= (const sharing_stack &other) { if (&other != this) { - fini (); + clear (); init (other._m_head, other._m_size); } return *this;