This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Enable new/delete C++ interceptors for OS X
ClosedPublic

Authored by kubamracek on Nov 6 2015, 12:39 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 39485.Nov 6 2015, 12:39 AM
kubamracek retitled this revision from to [tsan] Enable new/delete C++ interceptors for OS X.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, kcc, samsonov, glider.
dvyukov accepted this revision.Nov 6 2015, 2:04 AM
dvyukov edited edge metadata.
This revision is now accepted and ready to land.Nov 6 2015, 2:04 AM
This revision was automatically updated to reflect the committed changes.
glider added inline comments.Nov 10 2015, 5:00 PM
compiler-rt/trunk/lib/tsan/rtl/tsan_new_delete.cc
15

Please keep the includes list sorted (clang-format might be your friend - don't remember if we use it in TSan)

27

I actually don't think it's a good idea to rename REAL(malloc) into __libc_malloc to match the Linux name.
I also vaguely remember that it might not be 100% correct to use the default libc allocator for TSan. Dima, didn't we want to change this?

dvyukov added inline comments.Nov 11 2015, 1:37 AM
compiler-rt/trunk/lib/tsan/rtl/tsan_new_delete.cc
27

It is OK to call into system malloc in tsan.
It would be great to get rid of system malloc calls in tsan, though. But that's definitely more work than these 2 defines.
Tsan uses system malloc for historical reasons. Initially we did not have internal allocator (nor sanitizer allocator at all), and using custom slab allocators proved to be too painful. Current internal allocator can eat huge amounts of memory, though.

kubamracek added inline comments.Nov 11 2015, 7:17 AM
compiler-rt/trunk/lib/tsan/rtl/tsan_new_delete.cc
15

Fixed in r252735.