From: carlo Date: Wed, 25 Feb 2004 21:31:01 +0000 (+0000) Subject: * bits/demangle.h X-Git-Tag: upstream/4.9.2~72757 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdf178435b88dae557b318983178357198d7781c;p=platform%2Fupstream%2Flinaro-gcc.git * bits/demangle.h namespace __gnu_cxx::demangler (session::qualifier_list_Allocator): Add (session::M_qualifier_list_alloc): Add (session::decode_type_with_postfix): Use M_qualifier_list_alloc instead of calling operator new/delete. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78457 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7751810..2c16838 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2004-02-25 Carlo Wood + + * bits/demangle.h + namespace __gnu_cxx::demangler + (session::qualifier_list_Allocator): Add + (session::M_qualifier_list_alloc): Add + (session::decode_type_with_postfix): + Use M_qualifier_list_alloc instead of calling operator new/delete. + 2004-02-24 Paolo Carlini PR libstdc++/14252 @@ -163,7 +172,7 @@ * docs/html/ext/mt_allocator.html: Change due to that deallocated blocks now are added to the front of freelists. The reason to this approach is also explained. - + 2004-02-17 Paolo Carlini * include/bits/locale_facets.tcc (num_get<>::_M_extract_float, @@ -776,11 +785,11 @@ 2004-01-29 Stephen M. Webb * config/local/generic/c_locale.h: Change ::malloc() to new char[]. - * config/local/gnu/c_locale.h: Change ::malloc() to new char[]. - * include/bits/stl_tempbuf.h: Convert _Temporary_buffer to use + * config/local/gnu/c_locale.h: Change ::malloc() to new char[]. + * include/bits/stl_tempbuf.h: Convert _Temporary_buffer to use std::get_temporary_buffer() instead of duplicating its code. Update to C++STYLE conventions. - * include/std/std_memory.h (get_temporary_buffer): Use ::operator + * include/std/std_memory.h (get_temporary_buffer): Use ::operator new() instead of std::malloc(). (return_temporary_buffer): Use ::operator delete() instead of std::free(). diff --git a/libstdc++-v3/include/bits/demangle.h b/libstdc++-v3/include/bits/demangle.h index 021276a..68cdabe 100644 --- a/libstdc++-v3/include/bits/demangle.h +++ b/libstdc++-v3/include/bits/demangle.h @@ -378,6 +378,9 @@ namespace __gnu_cxx int M_template_arg_pos_offset; std::vector M_substitutions_pos; implementation_details const& M_implementation_details; + typedef typename Allocator::template + rebind >::other qualifier_list_Allocator; + qualifier_list_Allocator M_qualifier_list_alloc; #if _GLIBCXX_DEMANGLER_CWDEBUG bool M_inside_add_substitution; #endif @@ -1849,7 +1852,10 @@ namespace __gnu_cxx ++M_inside_type; bool recursive_template_param_or_substitution_call; if (!(recursive_template_param_or_substitution_call = qualifiers)) - qualifiers = new qualifier_list(*this); + { + qualifier_list* raw_qualifiers = M_qualifier_list_alloc.allocate(1); + qualifiers = new (raw_qualifiers) qualifier_list(*this); + } // First eat all qualifiers. bool failure = false; for(;;) // So we can use 'continue' to eat the next qualifier. @@ -2181,7 +2187,10 @@ namespace __gnu_cxx decode_type_exit: --M_inside_type; if (!recursive_template_param_or_substitution_call) - delete qualifiers; + { + qualifiers->~qualifier_list(); + M_qualifier_list_alloc.deallocate(qualifiers, 1); + } if (failure) _GLIBCXX_DEMANGLER_FAILURE; _GLIBCXX_DEMANGLER_RETURN2;