aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorPiJoules <6019989+PiJoules@users.noreply.github.com>2024-06-04 12:10:08 -0700
committerGitHub <noreply@github.com>2024-06-04 12:10:08 -0700
commit534590144f7c7ec34b8e5e95aba3e4f214b074eb (patch)
treea717e540982dd70f5e7ba2ce9145e8b3d5537254 /libc
parent9dd66f4ff7d8b0bff2304b6fd366c461b2807e78 (diff)
downloadllvm-534590144f7c7ec34b8e5e95aba3e4f214b074eb.zip
llvm-534590144f7c7ec34b8e5e95aba3e4f214b074eb.tar.gz
llvm-534590144f7c7ec34b8e5e95aba3e4f214b074eb.tar.bz2
[libc][new] Add placement new functions (#94290)
Diffstat (limited to 'libc')
-rw-r--r--libc/src/__support/CPP/new.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/src/__support/CPP/new.h b/libc/src/__support/CPP/new.h
index 6261dc1..72187b7 100644
--- a/libc/src/__support/CPP/new.h
+++ b/libc/src/__support/CPP/new.h
@@ -74,6 +74,10 @@ LIBC_INLINE void *operator new[](size_t size, std::align_val_t align,
return LIBC_NAMESPACE::AllocChecker::aligned_alloc(size, align, ac);
}
+LIBC_INLINE void *operator new(size_t, void *p) { return p; }
+
+LIBC_INLINE void *operator new[](size_t, void *p) { return p; }
+
// The ideal situation would be to define the various flavors of operator delete
// inlinelike we do with operator new above. However, since we need operator
// delete prototypes to match those specified by the C++ standard, we cannot