[all-commits] [llvm/llvm-project] 868317: [scudo] Rework Vector/String

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Thu Jun 3 18:13:07 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 868317b3fd765830c07ecf16cbfcf6c7708adc3c
      https://github.com/llvm/llvm-project/commit/868317b3fd765830c07ecf16cbfcf6c7708adc3c
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2021-06-03 (Thu, 03 Jun 2021)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/primary64.h
    M compiler-rt/lib/scudo/standalone/report.cpp
    M compiler-rt/lib/scudo/standalone/size_class_map.h
    M compiler-rt/lib/scudo/standalone/string_utils.cpp
    M compiler-rt/lib/scudo/standalone/string_utils.h
    M compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/quarantine_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/strings_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/vector_test.cpp
    M compiler-rt/lib/scudo/standalone/vector.h

  Log Message:
  -----------
  [scudo] Rework Vector/String

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.

Differential Revision: https://reviews.llvm.org/D103641




More information about the All-commits mailing list