[PATCH] D103641: [scudo] Rework Vector/String

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 12:11:46 PDT 2021


cryptoad created this revision.
cryptoad added reviewers: vitalybuka, eugenis, hctim, cferris, pcc.
Herald added a subscriber: JDevlieghere.
cryptoad requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Some platforms (eg: Trusty) are extremelly memory constrained, which
doesn't necessarily work well with some of Scudo's current assumptions.

`Vector` by default (and as such `String` and `ScopedString`) maps a
page, which is a bit of a waste. This CL changes `Vector` to use a
buffer local to the class first, then potentially map more memory if
needed (`ScopedString` currently are all stack based so it would be
stack data). We also want to allow a platform to prevent any dynamic
resizing, so I added a `CanGrow` templated parameter that for now is
always `true` but would be set to `false` on Trusty.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103641

Files:
  compiler-rt/lib/scudo/standalone/combined.h
  compiler-rt/lib/scudo/standalone/primary64.h
  compiler-rt/lib/scudo/standalone/size_class_map.h
  compiler-rt/lib/scudo/standalone/string_utils.cpp
  compiler-rt/lib/scudo/standalone/string_utils.h
  compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
  compiler-rt/lib/scudo/standalone/tests/quarantine_test.cpp
  compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
  compiler-rt/lib/scudo/standalone/vector.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103641.349641.patch
Type: text/x-patch
Size: 9591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210603/aa29daff/attachment.bin>


More information about the llvm-commits mailing list