<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 27, 2016 at 6:44 AM, Rafael EspĂ­ndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 26 October 2016 at 23:18, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
> Currently we have three allocators for each input file. What if we should<br>
> use three global allocators?<br>
<br>
</span>Yes, that worked. Thanks!<br></blockquote><div><br></div><div>Awesome!</div><div><br></div><div>What we are observing here is that almost all "large" objects, such as files, sections or symbols, are used for the entire lifetime of the linker once they are created. This usage characteristic makes it attractive to use an arena allocator where the entire linker is one arena. With an arena, newly created objects belong to the arena and freed all at once once everything is done. Your global allocator patch is aligned to that concept, and I think we should rewrite more code in that direction as it is efficient and easy to understand.</div></div></div></div>