Skip to content

Commit 0e3fe7b

Browse files
committed
This change switches back _dispatch_operation_perform to use posix_memalign
from aligned_malloc. This was caught by thread sanitizer.
1 parent 7776634 commit 0e3fe7b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/io.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,10 @@ _dispatch_operation_perform(dispatch_operation_t op)
23742374
}
23752375
op->buf = _aligned_malloc(op->buf_siz, siInfo.dwPageSize);
23762376
#else
2377-
op->buf = aligned_alloc((size_t)PAGE_SIZE, op->buf_siz);
2377+
err = posix_memalign(&op->buf, (size_t)PAGE_SIZE, op->buf_siz);
2378+
if (err != 0) {
2379+
goto error;
2380+
}
23782381
#endif
23792382
_dispatch_op_debug("buffer allocated", op);
23802383
} else if (op->direction == DOP_DIR_WRITE) {

0 commit comments

Comments
 (0)