This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Pair _aligned_malloc with _aligned_free
ClosedPublic

Authored by smeenai on Jan 10 2017, 1:22 AM.

Details

Summary

Attempting to pair an _aligned_malloc with a regular free causes heap
corruption. Pairing with _aligned_free is required instead.

Makes the following libc++ tests pass on Windows:

std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai updated this revision to Diff 83783.Jan 10 2017, 1:22 AM
smeenai retitled this revision from to [libc++] Pair _aligned_malloc with _aligned_free.
smeenai updated this object.
smeenai added reviewers: compnerd, EricWF, mclow.lists.
smeenai added a subscriber: cfe-commits.
compnerd accepted this revision.Jan 11 2017, 3:38 PM
compnerd edited edge metadata.

Hah, can't believe we missed that.

This revision is now accepted and ready to land.Jan 11 2017, 3:38 PM
This revision was automatically updated to reflect the committed changes.