HomePhabricator

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

Authored by kubamracek on Apr 14 2016, 2:05 AM.

Description

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

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.

Differential Revision: http://reviews.llvm.org/D19100

llvm-svn: 266283