xref: /aosp_15_r20/external/federated-compute/fcp/base/new.h (revision 14675a029014e728ec732f129a32e299b2da0601)
1 #ifndef FCP_BASE_NEW_H_
2 #define FCP_BASE_NEW_H_
3 
4 #ifdef FCP_NANOLIBC
5 // Definitions of placement operator new are needed because nanolibc doesn't
6 // currently have the <new> header.
new(size_t,void * p)7 inline void* operator new(size_t, void* p) noexcept { return p; }
8 inline void* operator new[](size_t, void* p) noexcept { return p; }
9 #else
10 #include <new>
11 #endif  // FCP_NANOLIBC
12 
13 #endif  // FCP_BASE_NEW_H_
14