HomePhabricator

[libc++] Pair _aligned_malloc with _aligned_free

Description

[libc++] Pair _aligned_malloc with _aligned_free

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

Differential Revision: https://reviews.llvm.org/D28512

Details