This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Support importing custom configuration
ClosedPublic

Authored by Chia-hungDuan on May 12 2023, 1:58 PM.

Details

Summary

To define custom allocation, you only need to put the configuration in
custom_scudo_config.h and define two required aliases, then you will be
switched to the customized config and the tests will also run with your
configuration.

In this CL, we also have a minor refactor the structure of
configuration. Now the essential fields are put under the associated
hierarchy and which will make the defining new configuration easier.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.May 12 2023, 1:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 1:58 PM
Chia-hungDuan requested review of this revision.May 12 2023, 1:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 1:58 PM
Herald added subscribers: Restricted Project, pcwang-thead. · View Herald Transcript
Chia-hungDuan added inline comments.May 12 2023, 3:53 PM
compiler-rt/lib/scudo/standalone/combined.h
46

Will change this to Config which may be more intuitive

49–50

I would like to see this as

using PrimaryT = typename Params::template PrimaryT<Params::Primary>

However, Config::MaySupportMemoryTagging is accessed in Primary and Secondary as well. Once we remove the dependency with the top level configuration in Primary and Secondary, we can switch to the above form.

cferris requested changes to this revision.May 30 2023, 7:54 PM
cferris added inline comments.
compiler-rt/lib/scudo/standalone/allocator_config.h
33

configuration

compiler-rt/lib/scudo/standalone/combined.h
46

Assuming you mean change Params to Config, yes, that seems like a good change.

This revision now requires changes to proceed.May 30 2023, 7:54 PM
Chia-hungDuan marked an inline comment as done.

Rename Params to Config and fix typo

Chia-hungDuan marked an inline comment as done.May 30 2023, 9:10 PM
Chia-hungDuan added inline comments.
compiler-rt/lib/scudo/standalone/combined.h
46

Yes, done

This revision is now accepted and ready to land.May 31 2023, 10:29 AM
This revision was automatically updated to reflect the committed changes.