Skip to content

Commit 5345901

Browse files
authored
[libc][new] Add placement new functions (llvm#94290)
1 parent 9dd66f4 commit 5345901

File tree

1 file changed

+4
-0
lines changed
  • libc/src/__support/CPP

1 file changed

+4
-0
lines changed

libc/src/__support/CPP/new.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ LIBC_INLINE void *operator new[](size_t size, std::align_val_t align,
7474
return LIBC_NAMESPACE::AllocChecker::aligned_alloc(size, align, ac);
7575
}
7676

77+
LIBC_INLINE void *operator new(size_t, void *p) { return p; }
78+
79+
LIBC_INLINE void *operator new[](size_t, void *p) { return p; }
80+
7781
// The ideal situation would be to define the various flavors of operator delete
7882
// inlinelike we do with operator new above. However, since we need operator
7983
// delete prototypes to match those specified by the C++ standard, we cannot

0 commit comments

Comments
 (0)