[PATCH] D33007: [scudo] Use our own combined allocator

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 09:52:34 PDT 2017


cryptoad created this revision.

The reasoning behind this change is twofold:

- the current combined allocator (sanitizer_allocator_combined.h) implements features that are not relevant for Scudo, making some code redundant, and some restrictions not pertinent (alignments for example). This forced us to do some weird things between the frontend and our secondary to make things work;
- we have enough information to be able to know if a chunk will be serviced by the Primary or Secondary, allowing us to avoid extraneous calls to functions such as `PointerIsMine` or `CanAllocate`.

As a result, the new scudo-specific combined allocator is very straightforward,
and allows us to remove some now unnecessary code both in the frontend and the
secondary. Unused functions have been left in as unimplemented for now.

It turns out to also be a sizeable performance gain (3% faster in some Android
memory_replay benchmarks, doing some more on other platforms).


https://reviews.llvm.org/D33007

Files:
  lib/scudo/scudo_allocator.cpp
  lib/scudo/scudo_allocator.h
  lib/scudo/scudo_allocator_combined.h
  lib/scudo/scudo_allocator_secondary.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33007.98315.patch
Type: text/x-patch
Size: 15899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170509/d772f945/attachment.bin>


More information about the llvm-commits mailing list