diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp @@ -17,9 +17,9 @@ #include #include +#include #include #include -#include #include #include "test_macros.h" @@ -59,7 +59,7 @@ constexpr char pattern = 0xDE; void* operator new(std::size_t count) { - void* ptr = malloc(count); + void* ptr = std::malloc(count); for (std::size_t i = 0; i < count; ++i) { *(reinterpret_cast(ptr) + i) = pattern; } @@ -68,7 +68,7 @@ void* operator new[](std::size_t count) { return ::operator new(count); } -void operator delete(void* ptr) noexcept { free(ptr); } +void operator delete(void* ptr) noexcept { std::free(ptr); } void operator delete[](void* ptr) noexcept { ::operator delete(ptr); } diff --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp --- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp +++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp @@ -20,13 +20,13 @@ #include #include #include +#include #include -#include constexpr char pattern = 0xDE; void* operator new(std::size_t count) { - void* ptr = malloc(count); + void* ptr = std::malloc(count); for (std::size_t i = 0; i < count; ++i) { *(reinterpret_cast(ptr) + i) = pattern; } @@ -35,7 +35,7 @@ void* operator new[](std::size_t count) { return ::operator new(count); } -void operator delete(void* ptr) noexcept { free(ptr); } +void operator delete(void* ptr) noexcept { std::free(ptr); } void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }