From 9de66be60d357cbf3ea7153c6f54569fab668818 Mon Sep 17 00:00:00 2001 From: jimblandy Date: Fri, 5 Oct 2012 21:59:33 +0000 Subject: Fix out-of-date comment for DwarfCUToModule::FilePrivate::common_strings. No review. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1063 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf_cu_to_module.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/common/dwarf_cu_to_module.cc') diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 081260c6..abcf36f8 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -101,12 +101,20 @@ struct DwarfCUToModule::FilePrivate { // A set of strings used in this CU. Before storing a string in one of // our data structures, insert it into this set, and then use the string // from the set. - // - // Because std::string uses reference counting internally, simply using - // strings from this set, even if passed by value, assigned, or held - // directly in structures and containers (map, for example), - // causes those strings to share a single instance of each distinct piece - // of text. + // + // In some STL implementations, strings are reference-counted internally, + // meaning that simply using strings from this set, even if passed by + // value, assigned, or held directly in structures and containers + // (map, for example), causes those strings to share a + // single instance of each distinct piece of text. GNU's libstdc++ uses + // reference counts, and I believe MSVC did as well, at some point. + // However, C++ '11 implementations are moving away from reference + // counting. + // + // In other implementations, string assignments copy the string's text, + // so this set will actually hold yet another copy of the string (although + // everything will still work). To improve memory consumption portably, + // we will probably need to use pointers to strings held in this set. set common_strings; // A map from offsets of DIEs within the .debug_info section to -- cgit v1.2.1