Skip to content

Commit 782aa0e

Browse files
Merge pull request #4447 from swiftwasm/main
[pull] swiftwasm from main
2 parents 76f2c74 + d6cc8e8 commit 782aa0e

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

include/swift/Runtime/Atomic.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ struct aligned_alloc<Alignment_, true> {
9595
free(ptr);
9696
#endif
9797
}
98-
99-
#if defined(_WIN32)
100-
// FIXME: why is this even needed? This is not permitted as per the C++
101-
// standrd new.delete.placement (§17.6.3.4).
102-
[[nodiscard]] void *operator new(std::size_t size, void *where) noexcept {
103-
return ::operator new(size, where);
104-
}
105-
#endif
10698
};
10799

108100
/// The default implementation for swift::atomic<T>, which just wraps

stdlib/public/runtime/MetadataImpl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include "EnumImpl.h"
5252

5353
#include <cstring>
54+
#include <new>
5455
#include <type_traits>
5556

5657
namespace swift {
@@ -99,11 +100,11 @@ struct NativeBox {
99100
}
100101

101102
static T *initializeWithCopy(T *dest, T *src) {
102-
return new (dest) T(*src);
103+
return ::new (dest) T(*src);
103104
}
104105

105106
static T *initializeWithTake(T *dest, T *src) {
106-
T *result = new (dest) T(std::move(*src));
107+
T *result = ::new (dest) T(std::move(*src));
107108
src->T::~T();
108109
return result;
109110
}

0 commit comments

Comments
 (0)