SmallVector and SmallPtrSet allocations not power-of-two aligned
Eric Christopher
echristo at gmail.com
Wed Mar 27 16:14:58 PDT 2013
Formatting nit:
- explicit SmallPtrSetIterator(const void *const *BP)
- : SmallPtrSetIteratorImpl(BP) {}
+ explicit SmallPtrSetIterator(const void *const *BP, const void *const
*E)
+ : SmallPtrSetIteratorImpl(BP, E) {}
Indenting.
-eric
On Wed, Mar 27, 2013 at 4:00 PM, Jean-Luc Duprat <jduprat at apple.com> wrote:
> Now with unit tests…
>
> JL
>
>
>
> On Mar 27, 2013, at 15:16 , Nadav Rotem <nrotem at apple.com> wrote:
>
> LGTM.
>
>
> On 03/27/13, *Jean-Luc Duprat * <jduprat at apple.com> wrote:
>
> While running dtrace on a large compile, focusing on memory usage, I found
> several strange allocations on x64.
> Here is the trimmed output of my dtrace run---these read: allocation
> size\t number of such allocations
>
> [snip: trimmed, leaving only allocation that seemed odd]
> 32776 156
> 16392 446
> 8200 604
> 4104 605
> 2056 614
> 1032 1212
>
> Note that these allocations are 1032 bytes (1024+8), 2056 bytes (2048+8),
> 4104 bytes (4096+8), etc.
>
> These were tracked down to SmallVector and SmallPtrSet, and the way they
> grow when no longer "small".
> For SmallVector the fix is pretty minimal, just using better logic to
> compute the size of the next allocation. For SmallPtrSet the fix involved
> getting the allocator to track the end of the set, growing the size of the
> allocator itself rather than growing the set.
>
> These changes moved all the allocations identified above to proper
> power-of-two allocations. These changes have no impact on performance, but
> will help pool memory allocations together if needed.
>
> Please provide feedback on the attached change.
> Thank you,
>
> JL
>
>
>
>
> ------------------------------
>
>
>
> ------------------------------
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130327/05ce8f41/attachment.html>
More information about the llvm-commits
mailing list