cxxalloc.cpp (955B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #define MOZ_MEMORY_IMPL 6 #include "mozmemory_wrap.h" 7 #define MALLOC_FUNCS MALLOC_FUNCS_MALLOC 8 // See mozmemory_wrap.h for more details. Files that are part of libmozglue, 9 // need to use _impl suffixes, which is becoming cumbersome. We'll have to use 10 // something like a malloc.h wrapper and allow the use of the functions without 11 // a _impl suffix. In the meanwhile, this is enough to get by for C++ code. 12 #define MALLOC_DECL(name, return_type, ...) \ 13 MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__); 14 #include "malloc_decls.h" 15 16 #include "mozilla/Attributes.h" 17 18 extern "C" MFBT_API void* moz_xmalloc(size_t size) MOZ_INFALLIBLE_ALLOCATOR; 19 20 namespace std { 21 struct nothrow_t; 22 } 23 24 #define MOZALLOC_EXPORT_NEW MFBT_API 25 26 #include "mozilla/cxxalloc.h"