1/* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#pragma once 18 19#include <stddef.h> 20 21extern "C++" { 22 23namespace std { 24 using ::size_t; 25 struct nothrow_t {}; 26 extern const nothrow_t nothrow; 27} 28 29void* operator new(std::size_t); 30void* operator new(std::size_t, const std::nothrow_t&); 31void operator delete(void*) throw(); 32// TODO: void operator delete(void*, std::size_t) throw(); 33void operator delete(void*, const std::nothrow_t&) throw(); 34 35void* operator new[](std::size_t); 36void* operator new[](std::size_t, const std::nothrow_t&); 37void operator delete[](void*) throw(); 38// TODO: void operator delete[](void*, std::size_t) throw(); 39void operator delete[](void*, const std::nothrow_t&) throw(); 40 41// These four are not replaceable, so should be inlined. 42inline void* operator new(std::size_t, void* p) { return p; } 43inline void* operator new[](std::size_t, void* p) { return p; } 44inline void operator delete(void*, void*) throw() { } 45inline void operator delete[](void*, void*) throw() { } 46 47} // extern C++ 48