1*58b9f456SAndroid Build Coastguard Worker //===--------------------------- new.cpp ----------------------------------===//
2*58b9f456SAndroid Build Coastguard Worker //
3*58b9f456SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure
4*58b9f456SAndroid Build Coastguard Worker //
5*58b9f456SAndroid Build Coastguard Worker // This file is dual licensed under the MIT and the University of Illinois Open
6*58b9f456SAndroid Build Coastguard Worker // Source Licenses. See LICENSE.TXT for details.
7*58b9f456SAndroid Build Coastguard Worker //
8*58b9f456SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*58b9f456SAndroid Build Coastguard Worker
10*58b9f456SAndroid Build Coastguard Worker #include <stdlib.h>
11*58b9f456SAndroid Build Coastguard Worker
12*58b9f456SAndroid Build Coastguard Worker #include "new"
13*58b9f456SAndroid Build Coastguard Worker #include "include/atomic_support.h"
14*58b9f456SAndroid Build Coastguard Worker
15*58b9f456SAndroid Build Coastguard Worker #if defined(_LIBCPP_ABI_MICROSOFT)
16*58b9f456SAndroid Build Coastguard Worker #if defined(_LIBCPP_NO_VCRUNTIME)
17*58b9f456SAndroid Build Coastguard Worker #include "support/runtime/new_handler_fallback.ipp"
18*58b9f456SAndroid Build Coastguard Worker #endif
19*58b9f456SAndroid Build Coastguard Worker #elif defined(LIBCXX_BUILDING_LIBCXXABI)
20*58b9f456SAndroid Build Coastguard Worker #include <cxxabi.h>
21*58b9f456SAndroid Build Coastguard Worker #elif defined(LIBCXXRT)
22*58b9f456SAndroid Build Coastguard Worker #include <cxxabi.h>
23*58b9f456SAndroid Build Coastguard Worker #include "support/runtime/new_handler_fallback.ipp"
24*58b9f456SAndroid Build Coastguard Worker #elif defined(__GLIBCXX__)
25*58b9f456SAndroid Build Coastguard Worker // nothing todo
26*58b9f456SAndroid Build Coastguard Worker #else
27*58b9f456SAndroid Build Coastguard Worker # if defined(__APPLE__) && !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY)
28*58b9f456SAndroid Build Coastguard Worker # include <cxxabi.h> // FIXME: remove this once buildit is gone.
29*58b9f456SAndroid Build Coastguard Worker # else
30*58b9f456SAndroid Build Coastguard Worker # include "support/runtime/new_handler_fallback.ipp"
31*58b9f456SAndroid Build Coastguard Worker # endif
32*58b9f456SAndroid Build Coastguard Worker #endif
33*58b9f456SAndroid Build Coastguard Worker
34*58b9f456SAndroid Build Coastguard Worker namespace std
35*58b9f456SAndroid Build Coastguard Worker {
36*58b9f456SAndroid Build Coastguard Worker
37*58b9f456SAndroid Build Coastguard Worker #ifndef __GLIBCXX__
38*58b9f456SAndroid Build Coastguard Worker const nothrow_t nothrow = {};
39*58b9f456SAndroid Build Coastguard Worker #endif
40*58b9f456SAndroid Build Coastguard Worker
41*58b9f456SAndroid Build Coastguard Worker #ifndef LIBSTDCXX
42*58b9f456SAndroid Build Coastguard Worker
43*58b9f456SAndroid Build Coastguard Worker void
__throw_bad_alloc()44*58b9f456SAndroid Build Coastguard Worker __throw_bad_alloc()
45*58b9f456SAndroid Build Coastguard Worker {
46*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
47*58b9f456SAndroid Build Coastguard Worker throw bad_alloc();
48*58b9f456SAndroid Build Coastguard Worker #else
49*58b9f456SAndroid Build Coastguard Worker _VSTD::abort();
50*58b9f456SAndroid Build Coastguard Worker #endif
51*58b9f456SAndroid Build Coastguard Worker }
52*58b9f456SAndroid Build Coastguard Worker
53*58b9f456SAndroid Build Coastguard Worker #endif // !LIBSTDCXX
54*58b9f456SAndroid Build Coastguard Worker
55*58b9f456SAndroid Build Coastguard Worker } // std
56*58b9f456SAndroid Build Coastguard Worker
57*58b9f456SAndroid Build Coastguard Worker #if !defined(__GLIBCXX__) && \
58*58b9f456SAndroid Build Coastguard Worker !defined(_LIBCPP_DEFER_NEW_TO_VCRUNTIME) && \
59*58b9f456SAndroid Build Coastguard Worker !defined(_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
60*58b9f456SAndroid Build Coastguard Worker
61*58b9f456SAndroid Build Coastguard Worker // Implement all new and delete operators as weak definitions
62*58b9f456SAndroid Build Coastguard Worker // in this shared library, so that they can be overridden by programs
63*58b9f456SAndroid Build Coastguard Worker // that define non-weak copies of the functions.
64*58b9f456SAndroid Build Coastguard Worker
65*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
66*58b9f456SAndroid Build Coastguard Worker void *
operator new(std::size_t size)67*58b9f456SAndroid Build Coastguard Worker operator new(std::size_t size) _THROW_BAD_ALLOC
68*58b9f456SAndroid Build Coastguard Worker {
69*58b9f456SAndroid Build Coastguard Worker if (size == 0)
70*58b9f456SAndroid Build Coastguard Worker size = 1;
71*58b9f456SAndroid Build Coastguard Worker void* p;
72*58b9f456SAndroid Build Coastguard Worker while ((p = ::malloc(size)) == 0)
73*58b9f456SAndroid Build Coastguard Worker {
74*58b9f456SAndroid Build Coastguard Worker // If malloc fails and there is a new_handler,
75*58b9f456SAndroid Build Coastguard Worker // call it to try free up memory.
76*58b9f456SAndroid Build Coastguard Worker std::new_handler nh = std::get_new_handler();
77*58b9f456SAndroid Build Coastguard Worker if (nh)
78*58b9f456SAndroid Build Coastguard Worker nh();
79*58b9f456SAndroid Build Coastguard Worker else
80*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
81*58b9f456SAndroid Build Coastguard Worker throw std::bad_alloc();
82*58b9f456SAndroid Build Coastguard Worker #else
83*58b9f456SAndroid Build Coastguard Worker break;
84*58b9f456SAndroid Build Coastguard Worker #endif
85*58b9f456SAndroid Build Coastguard Worker }
86*58b9f456SAndroid Build Coastguard Worker return p;
87*58b9f456SAndroid Build Coastguard Worker }
88*58b9f456SAndroid Build Coastguard Worker
89*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
90*58b9f456SAndroid Build Coastguard Worker void*
operator new(size_t size,const std::nothrow_t &)91*58b9f456SAndroid Build Coastguard Worker operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
92*58b9f456SAndroid Build Coastguard Worker {
93*58b9f456SAndroid Build Coastguard Worker void* p = 0;
94*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
95*58b9f456SAndroid Build Coastguard Worker try
96*58b9f456SAndroid Build Coastguard Worker {
97*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_NO_EXCEPTIONS
98*58b9f456SAndroid Build Coastguard Worker p = ::operator new(size);
99*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
100*58b9f456SAndroid Build Coastguard Worker }
101*58b9f456SAndroid Build Coastguard Worker catch (...)
102*58b9f456SAndroid Build Coastguard Worker {
103*58b9f456SAndroid Build Coastguard Worker }
104*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_NO_EXCEPTIONS
105*58b9f456SAndroid Build Coastguard Worker return p;
106*58b9f456SAndroid Build Coastguard Worker }
107*58b9f456SAndroid Build Coastguard Worker
108*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
109*58b9f456SAndroid Build Coastguard Worker void*
operator new[](size_t size)110*58b9f456SAndroid Build Coastguard Worker operator new[](size_t size) _THROW_BAD_ALLOC
111*58b9f456SAndroid Build Coastguard Worker {
112*58b9f456SAndroid Build Coastguard Worker return ::operator new(size);
113*58b9f456SAndroid Build Coastguard Worker }
114*58b9f456SAndroid Build Coastguard Worker
115*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
116*58b9f456SAndroid Build Coastguard Worker void*
operator new[](size_t size,const std::nothrow_t &)117*58b9f456SAndroid Build Coastguard Worker operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
118*58b9f456SAndroid Build Coastguard Worker {
119*58b9f456SAndroid Build Coastguard Worker void* p = 0;
120*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
121*58b9f456SAndroid Build Coastguard Worker try
122*58b9f456SAndroid Build Coastguard Worker {
123*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_NO_EXCEPTIONS
124*58b9f456SAndroid Build Coastguard Worker p = ::operator new[](size);
125*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
126*58b9f456SAndroid Build Coastguard Worker }
127*58b9f456SAndroid Build Coastguard Worker catch (...)
128*58b9f456SAndroid Build Coastguard Worker {
129*58b9f456SAndroid Build Coastguard Worker }
130*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_NO_EXCEPTIONS
131*58b9f456SAndroid Build Coastguard Worker return p;
132*58b9f456SAndroid Build Coastguard Worker }
133*58b9f456SAndroid Build Coastguard Worker
134*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
135*58b9f456SAndroid Build Coastguard Worker void
operator delete(void * ptr)136*58b9f456SAndroid Build Coastguard Worker operator delete(void* ptr) _NOEXCEPT
137*58b9f456SAndroid Build Coastguard Worker {
138*58b9f456SAndroid Build Coastguard Worker ::free(ptr);
139*58b9f456SAndroid Build Coastguard Worker }
140*58b9f456SAndroid Build Coastguard Worker
141*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
142*58b9f456SAndroid Build Coastguard Worker void
operator delete(void * ptr,const std::nothrow_t &)143*58b9f456SAndroid Build Coastguard Worker operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
144*58b9f456SAndroid Build Coastguard Worker {
145*58b9f456SAndroid Build Coastguard Worker ::operator delete(ptr);
146*58b9f456SAndroid Build Coastguard Worker }
147*58b9f456SAndroid Build Coastguard Worker
148*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
149*58b9f456SAndroid Build Coastguard Worker void
operator delete(void * ptr,size_t)150*58b9f456SAndroid Build Coastguard Worker operator delete(void* ptr, size_t) _NOEXCEPT
151*58b9f456SAndroid Build Coastguard Worker {
152*58b9f456SAndroid Build Coastguard Worker ::operator delete(ptr);
153*58b9f456SAndroid Build Coastguard Worker }
154*58b9f456SAndroid Build Coastguard Worker
155*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
156*58b9f456SAndroid Build Coastguard Worker void
operator delete[](void * ptr)157*58b9f456SAndroid Build Coastguard Worker operator delete[] (void* ptr) _NOEXCEPT
158*58b9f456SAndroid Build Coastguard Worker {
159*58b9f456SAndroid Build Coastguard Worker ::operator delete(ptr);
160*58b9f456SAndroid Build Coastguard Worker }
161*58b9f456SAndroid Build Coastguard Worker
162*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
163*58b9f456SAndroid Build Coastguard Worker void
operator delete[](void * ptr,const std::nothrow_t &)164*58b9f456SAndroid Build Coastguard Worker operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
165*58b9f456SAndroid Build Coastguard Worker {
166*58b9f456SAndroid Build Coastguard Worker ::operator delete[](ptr);
167*58b9f456SAndroid Build Coastguard Worker }
168*58b9f456SAndroid Build Coastguard Worker
169*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
170*58b9f456SAndroid Build Coastguard Worker void
operator delete[](void * ptr,size_t)171*58b9f456SAndroid Build Coastguard Worker operator delete[] (void* ptr, size_t) _NOEXCEPT
172*58b9f456SAndroid Build Coastguard Worker {
173*58b9f456SAndroid Build Coastguard Worker ::operator delete[](ptr);
174*58b9f456SAndroid Build Coastguard Worker }
175*58b9f456SAndroid Build Coastguard Worker
176*58b9f456SAndroid Build Coastguard Worker #if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
177*58b9f456SAndroid Build Coastguard Worker
178*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
179*58b9f456SAndroid Build Coastguard Worker void *
operator new(std::size_t size,std::align_val_t alignment)180*58b9f456SAndroid Build Coastguard Worker operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
181*58b9f456SAndroid Build Coastguard Worker {
182*58b9f456SAndroid Build Coastguard Worker if (size == 0)
183*58b9f456SAndroid Build Coastguard Worker size = 1;
184*58b9f456SAndroid Build Coastguard Worker if (static_cast<size_t>(alignment) < sizeof(void*))
185*58b9f456SAndroid Build Coastguard Worker alignment = std::align_val_t(sizeof(void*));
186*58b9f456SAndroid Build Coastguard Worker void* p;
187*58b9f456SAndroid Build Coastguard Worker #if defined(_LIBCPP_MSVCRT_LIKE)
188*58b9f456SAndroid Build Coastguard Worker while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
189*58b9f456SAndroid Build Coastguard Worker #else
190*58b9f456SAndroid Build Coastguard Worker while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
191*58b9f456SAndroid Build Coastguard Worker #endif
192*58b9f456SAndroid Build Coastguard Worker {
193*58b9f456SAndroid Build Coastguard Worker // If posix_memalign fails and there is a new_handler,
194*58b9f456SAndroid Build Coastguard Worker // call it to try free up memory.
195*58b9f456SAndroid Build Coastguard Worker std::new_handler nh = std::get_new_handler();
196*58b9f456SAndroid Build Coastguard Worker if (nh)
197*58b9f456SAndroid Build Coastguard Worker nh();
198*58b9f456SAndroid Build Coastguard Worker else {
199*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
200*58b9f456SAndroid Build Coastguard Worker throw std::bad_alloc();
201*58b9f456SAndroid Build Coastguard Worker #else
202*58b9f456SAndroid Build Coastguard Worker p = nullptr; // posix_memalign doesn't initialize 'p' on failure
203*58b9f456SAndroid Build Coastguard Worker break;
204*58b9f456SAndroid Build Coastguard Worker #endif
205*58b9f456SAndroid Build Coastguard Worker }
206*58b9f456SAndroid Build Coastguard Worker }
207*58b9f456SAndroid Build Coastguard Worker return p;
208*58b9f456SAndroid Build Coastguard Worker }
209*58b9f456SAndroid Build Coastguard Worker
210*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
211*58b9f456SAndroid Build Coastguard Worker void*
operator new(size_t size,std::align_val_t alignment,const std::nothrow_t &)212*58b9f456SAndroid Build Coastguard Worker operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
213*58b9f456SAndroid Build Coastguard Worker {
214*58b9f456SAndroid Build Coastguard Worker void* p = 0;
215*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
216*58b9f456SAndroid Build Coastguard Worker try
217*58b9f456SAndroid Build Coastguard Worker {
218*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_NO_EXCEPTIONS
219*58b9f456SAndroid Build Coastguard Worker p = ::operator new(size, alignment);
220*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
221*58b9f456SAndroid Build Coastguard Worker }
222*58b9f456SAndroid Build Coastguard Worker catch (...)
223*58b9f456SAndroid Build Coastguard Worker {
224*58b9f456SAndroid Build Coastguard Worker }
225*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_NO_EXCEPTIONS
226*58b9f456SAndroid Build Coastguard Worker return p;
227*58b9f456SAndroid Build Coastguard Worker }
228*58b9f456SAndroid Build Coastguard Worker
229*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
230*58b9f456SAndroid Build Coastguard Worker void*
operator new[](size_t size,std::align_val_t alignment)231*58b9f456SAndroid Build Coastguard Worker operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
232*58b9f456SAndroid Build Coastguard Worker {
233*58b9f456SAndroid Build Coastguard Worker return ::operator new(size, alignment);
234*58b9f456SAndroid Build Coastguard Worker }
235*58b9f456SAndroid Build Coastguard Worker
236*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
237*58b9f456SAndroid Build Coastguard Worker void*
operator new[](size_t size,std::align_val_t alignment,const std::nothrow_t &)238*58b9f456SAndroid Build Coastguard Worker operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
239*58b9f456SAndroid Build Coastguard Worker {
240*58b9f456SAndroid Build Coastguard Worker void* p = 0;
241*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
242*58b9f456SAndroid Build Coastguard Worker try
243*58b9f456SAndroid Build Coastguard Worker {
244*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_NO_EXCEPTIONS
245*58b9f456SAndroid Build Coastguard Worker p = ::operator new[](size, alignment);
246*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_NO_EXCEPTIONS
247*58b9f456SAndroid Build Coastguard Worker }
248*58b9f456SAndroid Build Coastguard Worker catch (...)
249*58b9f456SAndroid Build Coastguard Worker {
250*58b9f456SAndroid Build Coastguard Worker }
251*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_NO_EXCEPTIONS
252*58b9f456SAndroid Build Coastguard Worker return p;
253*58b9f456SAndroid Build Coastguard Worker }
254*58b9f456SAndroid Build Coastguard Worker
255*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
256*58b9f456SAndroid Build Coastguard Worker void
operator delete(void * ptr,std::align_val_t)257*58b9f456SAndroid Build Coastguard Worker operator delete(void* ptr, std::align_val_t) _NOEXCEPT
258*58b9f456SAndroid Build Coastguard Worker {
259*58b9f456SAndroid Build Coastguard Worker #if defined(_LIBCPP_MSVCRT_LIKE)
260*58b9f456SAndroid Build Coastguard Worker ::_aligned_free(ptr);
261*58b9f456SAndroid Build Coastguard Worker #else
262*58b9f456SAndroid Build Coastguard Worker ::free(ptr);
263*58b9f456SAndroid Build Coastguard Worker #endif
264*58b9f456SAndroid Build Coastguard Worker }
265*58b9f456SAndroid Build Coastguard Worker
266*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
267*58b9f456SAndroid Build Coastguard Worker void
operator delete(void * ptr,std::align_val_t alignment,const std::nothrow_t &)268*58b9f456SAndroid Build Coastguard Worker operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
269*58b9f456SAndroid Build Coastguard Worker {
270*58b9f456SAndroid Build Coastguard Worker ::operator delete(ptr, alignment);
271*58b9f456SAndroid Build Coastguard Worker }
272*58b9f456SAndroid Build Coastguard Worker
273*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
274*58b9f456SAndroid Build Coastguard Worker void
operator delete(void * ptr,size_t,std::align_val_t alignment)275*58b9f456SAndroid Build Coastguard Worker operator delete(void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
276*58b9f456SAndroid Build Coastguard Worker {
277*58b9f456SAndroid Build Coastguard Worker ::operator delete(ptr, alignment);
278*58b9f456SAndroid Build Coastguard Worker }
279*58b9f456SAndroid Build Coastguard Worker
280*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
281*58b9f456SAndroid Build Coastguard Worker void
operator delete[](void * ptr,std::align_val_t alignment)282*58b9f456SAndroid Build Coastguard Worker operator delete[] (void* ptr, std::align_val_t alignment) _NOEXCEPT
283*58b9f456SAndroid Build Coastguard Worker {
284*58b9f456SAndroid Build Coastguard Worker ::operator delete(ptr, alignment);
285*58b9f456SAndroid Build Coastguard Worker }
286*58b9f456SAndroid Build Coastguard Worker
287*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
288*58b9f456SAndroid Build Coastguard Worker void
operator delete[](void * ptr,std::align_val_t alignment,const std::nothrow_t &)289*58b9f456SAndroid Build Coastguard Worker operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
290*58b9f456SAndroid Build Coastguard Worker {
291*58b9f456SAndroid Build Coastguard Worker ::operator delete[](ptr, alignment);
292*58b9f456SAndroid Build Coastguard Worker }
293*58b9f456SAndroid Build Coastguard Worker
294*58b9f456SAndroid Build Coastguard Worker _LIBCPP_WEAK
295*58b9f456SAndroid Build Coastguard Worker void
operator delete[](void * ptr,size_t,std::align_val_t alignment)296*58b9f456SAndroid Build Coastguard Worker operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
297*58b9f456SAndroid Build Coastguard Worker {
298*58b9f456SAndroid Build Coastguard Worker ::operator delete[](ptr, alignment);
299*58b9f456SAndroid Build Coastguard Worker }
300*58b9f456SAndroid Build Coastguard Worker
301*58b9f456SAndroid Build Coastguard Worker #endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
302*58b9f456SAndroid Build Coastguard Worker #endif // !__GLIBCXX__ && (!_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME) && !_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS
303