|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32\common\gcchelp.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "common.h" |
|
19 #ifdef __KERNEL_MODE__ |
|
20 #include <kernel/kernel.h> |
|
21 #endif |
|
22 |
|
23 #ifndef __X86__ // the declarations in this block are done elsewhere on x86 |
|
24 |
|
25 EXPORT_C TAny* operator new(TUint aSize) __NO_THROW |
|
26 // |
|
27 // The global new operator. |
|
28 // |
|
29 { |
|
30 |
|
31 return STD_CLASS::Alloc(aSize); |
|
32 } |
|
33 |
|
34 EXPORT_C TAny* operator new[](TUint aSize) __NO_THROW |
|
35 { |
|
36 |
|
37 return STD_CLASS::Alloc(aSize); |
|
38 } |
|
39 |
|
40 EXPORT_C TAny* operator new(TUint aSize, TUint aExtraSize) __NO_THROW |
|
41 // |
|
42 // Allocate the requested size plus the extra. |
|
43 // |
|
44 { |
|
45 |
|
46 return STD_CLASS::Alloc(aSize + aExtraSize); |
|
47 } |
|
48 |
|
49 EXPORT_C void operator delete(TAny* aPtr) __NO_THROW |
|
50 // |
|
51 // The replacement delete operator. |
|
52 // |
|
53 { |
|
54 |
|
55 STD_CLASS::Free(aPtr); |
|
56 } |
|
57 |
|
58 EXPORT_C void operator delete[](TAny* aPtr) __NO_THROW |
|
59 { |
|
60 |
|
61 STD_CLASS::Free(aPtr); |
|
62 } |
|
63 |
|
64 #endif //!defined(__X86__) |
|
65 |
|
66 #ifdef __ARMCC__ |
|
67 |
|
68 EXPORT_C TAny* operator new(TUint aSize, const std::nothrow_t& aNoThrow) __NO_THROW |
|
69 // |
|
70 // The global new operator. |
|
71 // |
|
72 { |
|
73 (void)aNoThrow; |
|
74 return STD_CLASS::Alloc(aSize); |
|
75 } |
|
76 |
|
77 EXPORT_C TAny* operator new[](TUint aSize, const std::nothrow_t& aNoThrow) __NO_THROW |
|
78 { |
|
79 (void)aNoThrow; |
|
80 return STD_CLASS::Alloc(aSize); |
|
81 } |
|
82 |
|
83 #endif |
|
84 |