This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Fix size reporting for OS X zone allocator with 0-sized allocations
ClosedPublic

Authored by kubamracek on Apr 14 2016, 1:50 AM.

Details

Summary

The custom zone implementation for OS X must not return 0 (even for 0-sized allocations). Returning 0 indicates that the pointer doesn't belong to the zone. This can break existing applications. The underlaying allocator allocates 1 byte for 0-sized allocations anyway, so returning 1 in this case is okay.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 53670.Apr 14 2016, 1:50 AM
kubamracek retitled this revision from to [tsan] Fix size reporting for OS X zone allocator with 0-sized allocations.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, glider, samsonov, kcc.
dvyukov accepted this revision.Apr 14 2016, 2:08 AM
dvyukov edited edge metadata.
This revision is now accepted and ready to land.Apr 14 2016, 2:08 AM
This revision was automatically updated to reflect the committed changes.