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


Cary Coutant <ccoutant@google.com> writes:

>>>        * 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.

This is OK.  This sounds great.  Thanks for looking into this.

There may be a minor win available by reserving the size of the
merged_strings_list vector for a large input section.

Ian


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