Index: test/tsan/Darwin/gcd-fd.mm =================================================================== --- test/tsan/Darwin/gcd-fd.mm +++ test/tsan/Darwin/gcd-fd.mm @@ -17,8 +17,8 @@ 0666, queue, ^(int error) { }); dispatch_io_set_high_water(channel, 1); - NSData *ns_data = [NSMutableData dataWithLength:1000]; - dispatch_data_t data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); + char buf[1000]; + dispatch_data_t data = dispatch_data_create(buf, sizeof(buf), NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); my_global++; dispatch_io_write(channel, 0, data, queue, ^(bool done, dispatch_data_t remainingData, int error) { Index: test/tsan/Darwin/gcd-io-barrier-race.mm =================================================================== --- test/tsan/Darwin/gcd-io-barrier-race.mm +++ test/tsan/Darwin/gcd-io-barrier-race.mm @@ -21,8 +21,8 @@ sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; - NSData *ns_data = [NSMutableData dataWithLength:1000]; - data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); + char buf[1000]; + data = dispatch_data_create(buf, sizeof(buf), NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); if (! channel) abort(); Index: test/tsan/Darwin/gcd-io-barrier.mm =================================================================== --- test/tsan/Darwin/gcd-io-barrier.mm +++ test/tsan/Darwin/gcd-io-barrier.mm @@ -17,8 +17,8 @@ sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; - NSData *ns_data = [NSMutableData dataWithLength:1000]; - data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); + char buf[1000]; + data = dispatch_data_create(buf, sizeof(buf), NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); if (! channel) abort(); Index: test/tsan/Darwin/gcd-io-race.mm =================================================================== --- test/tsan/Darwin/gcd-io-race.mm +++ test/tsan/Darwin/gcd-io-race.mm @@ -23,8 +23,8 @@ sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; - NSData *ns_data = [NSMutableData dataWithLength:1000]; - data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); + char buf[1000]; + data = dispatch_data_create(buf, sizeof(buf), NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); if (! channel) abort(); Index: test/tsan/Darwin/gcd-io.mm =================================================================== --- test/tsan/Darwin/gcd-io.mm +++ test/tsan/Darwin/gcd-io.mm @@ -100,8 +100,8 @@ sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; - NSData *ns_data = [NSMutableData dataWithLength:1000]; - data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); + char buf[1000]; + data = dispatch_data_create(buf, sizeof(buf), NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); test_dispatch_io_write(); test_dispatch_write();