This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: [gold][patch] Reduce heap usage for string merge sections


>> This time with the patch attached.
>
> OK, this time with the *right* patch attached. Sorry!

Here's a slight tweak to that patch -- I should have deleted each
Merged_strings struct after processing it in finalize_merged_data()
rather than just clearing the list inside it.

The Changelog entry is the same as before.

-cary

diff --git a/gold/merge.cc b/gold/merge.cc
index e5aa6db..6c512a8 100644
--- a/gold/merge.cc
+++ b/gold/merge.cc
@@ -624,7 +624,7 @@ Output_merge_string<Char_type>::finalize_merged_data()
            last_output_offset =
                this->stringpool_.get_offset_from_key(p->stringpool_key);
        }
-      (*l)->merged_strings.clear();
+      delete *l;
     }

   // Save some memory.  This also ensures that this function will work

>>> ? ? ? ?* merge.h (Output_merge_string::Merged_string): Remove object, shndx,
>>> ? ? ? ?string, and length fields.
>>> ? ? ? ?(Output_merge_string::Merged_strings_list): New type.
>>> ? ? ? ?(Output_merge_string::Merged_strings_lists): New typedef.
>>> ? ? ? ?(Output_merge_string): Replace merged_strings_ with
>>> ? ? ? ?merged_strings_lists_.
>>> ? ? ? ?* merge.cc (Output_merge_string::do_add_input_section): Allocate new
>>> ? ? ? ?Merged_strings_list per input object and section. ?Don't store pointer
>>> ? ? ? ?to the string. ?Don't store length with each merged string entry.
>>> ? ? ? ?(Output_merge_string::finalize_merged_data): Loop over list of merged
>>> ? ? ? ?strings lists. ?Recompute length of each merged string.


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