First public contribution.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\common\gcchelp.cpp
19 #ifdef __KERNEL_MODE__
20 #include <kernel/kernel.h>
23 #ifndef __X86__ // the declarations in this block are done elsewhere on x86
25 EXPORT_C TAny* operator new(TUint aSize) __NO_THROW
27 // The global new operator.
31 return STD_CLASS::Alloc(aSize);
34 EXPORT_C TAny* operator new[](TUint aSize) __NO_THROW
37 return STD_CLASS::Alloc(aSize);
40 EXPORT_C TAny* operator new(TUint aSize, TUint aExtraSize) __NO_THROW
42 // Allocate the requested size plus the extra.
46 return STD_CLASS::Alloc(aSize + aExtraSize);
49 EXPORT_C void operator delete(TAny* aPtr) __NO_THROW
51 // The replacement delete operator.
55 STD_CLASS::Free(aPtr);
58 EXPORT_C void operator delete[](TAny* aPtr) __NO_THROW
61 STD_CLASS::Free(aPtr);
64 #endif //!defined(__X86__)
68 EXPORT_C TAny* operator new(TUint aSize, const std::nothrow_t& aNoThrow) __NO_THROW
70 // The global new operator.
74 return STD_CLASS::Alloc(aSize);
77 EXPORT_C TAny* operator new[](TUint aSize, const std::nothrow_t& aNoThrow) __NO_THROW
80 return STD_CLASS::Alloc(aSize);