This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Switch to InternalAlloc everywhere __libc_malloc is currently used
ClosedPublic

Authored by kubamracek on Jun 6 2016, 8:55 AM.

Details

Summary

This patch replaces all uses of __libc_malloc and friends with the internal allocator.

It seems that the only reason why we have calls to __libc_malloc in the first place was the lack of the internal allocator at the time. Using the internal allocator will also make sure that the system allocator is never used (this is the same behavior as ASan), and we don’t have to worry about working with unknown pointers coming from the system allocator.

Diff Detail

Event Timeline

kubamracek updated this revision to Diff 59728.Jun 6 2016, 8:55 AM
kubamracek retitled this revision from to [tsan] Switch to InternalAlloc everywhere __libc_malloc is currently used.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, samsonov, glider, kcc.
kubamracek added a project: Restricted Project.
dvyukov accepted this revision.Jun 6 2016, 9:26 AM
dvyukov edited edge metadata.

LGTM

Thanks!

lib/sanitizer_common/sanitizer_allocator.cc
65

while you are here:

defined(SANITIZER_GO) || defined(SANITIZER_USE_MALLOC)

118

while you are here:

defined(SANITIZER_GO) || defined(SANITIZER_USE_MALLOC)

This revision is now accepted and ready to land.Jun 6 2016, 9:26 AM
This revision was automatically updated to reflect the committed changes.