This is an archive of the discontinued LLVM Phabricator instance.

[asan] Use linker initialization for the allocator
ClosedPublic

Authored by kubamracek on Nov 29 2017, 4:00 PM.

Details

Summary

This saves ~2 MB of dirty memory footprint. Can be a big deal on mobile devices especially when running multiple processes with ASan.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek created this revision.Nov 29 2017, 4:00 PM
Herald added a subscriber: Restricted Project. · View Herald TranscriptNov 29 2017, 4:00 PM
alekseyshl added inline comments.Nov 29 2017, 4:35 PM
lib/asan/asan_allocator.cc
823 ↗(On Diff #124844)

And where's /*linker_initialized*/ true call?

kubamracek added inline comments.Nov 29 2017, 4:40 PM
lib/asan/asan_allocator.cc
823 ↗(On Diff #124844)

There's none. ASan's allocator is currently always linker initialized. Would you prefer to just call InitLinkerInitialized always?

alekseyshl added inline comments.Nov 30 2017, 11:08 AM
lib/asan/asan_allocator.cc
823 ↗(On Diff #124844)

No, I just don't see how this, seemingly no op, change saves 2 MB.

Ah, sorry. linker_initialized should of course be "true".

alekseyshl accepted this revision.Nov 30 2017, 12:29 PM

Ah, sorry. linker_initialized should of course be "true".

Great! I thought there's a file missing from the patch or something like this.

lib/asan/asan_allocator.cc
277 ↗(On Diff #124984)

Rename this to InitLinkerInitialized and drop the parameter.

This revision is now accepted and ready to land.Nov 30 2017, 12:29 PM
This revision was automatically updated to reflect the committed changes.