This is an archive of the discontinued LLVM Phabricator instance.

[ASan] Introduce AllocatorOptions to configure allocator behavior.
ClosedPublic

Authored by samsonov on Dec 17 2014, 1:04 PM.

Details

Summary

Reduce the dependency of allocator code on runtime flags. Instead,
pass a bunch of options that configure allocator behavior at
initialization or re-initialization. That would allow us to
cleaner modify allocator behavior during a program execution
when ASan is activated or de-activated.

Diff Detail

Repository
rL LLVM

Event Timeline

samsonov updated this revision to Diff 17410.Dec 17 2014, 1:04 PM
samsonov retitled this revision from to [ASan] Introduce AllocatorOptions to configure allocator behavior..
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added a reviewer: kcc.
samsonov added subscribers: eugenis, Unknown Object (MLST).
kcc edited edge metadata.Dec 17 2014, 2:15 PM

Some of these options may be accessed on fast path, so I'd like to have the struct as small as possible

lib/asan/asan_allocator.cc
222 ↗(On Diff #17410)

maybe u16?

lib/asan/asan_allocator.h
35 ↗(On Diff #17410)

group the fields so that the struct is as small as possible.
also make quarantine_size quarantine_size_mb (for now, only the internal one, but I'd love to make the external flag to be _mb too).
and make it u32

38 ↗(On Diff #17410)

maybe u16?

samsonov updated this revision to Diff 17417.Dec 17 2014, 5:25 PM
samsonov edited edge metadata.
  • Introduced AllocatorOptions::SetFrom() to initialize from flags.
  • Reorder the fields.
lib/asan/asan_allocator.cc
222 ↗(On Diff #17410)

Done

lib/asan/asan_allocator.h
35 ↗(On Diff #17410)

Done

38 ↗(On Diff #17410)

Done

kcc accepted this revision.Dec 19 2014, 11:28 AM
kcc edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 19 2014, 11:28 AM
This revision was automatically updated to reflect the committed changes.