equal
deleted
inserted
replaced
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: operator new overloads |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef OSNNEW_H |
|
21 #define OSNNEW_H |
|
22 |
|
23 #ifdef __GNUC__ |
|
24 #include <stdexcept> |
|
25 #endif |
|
26 #include <osn/osndefines.h> |
|
27 |
|
28 #ifndef __GNUC__ |
|
29 namespace std |
|
30 { |
|
31 class bad_alloc; |
|
32 } |
|
33 #endif |
|
34 enum newarg {EMM}; |
|
35 |
|
36 typedef unsigned int size_t; |
|
37 |
|
38 /** |
|
39 * Overloaded operator new. |
|
40 * |
|
41 * @since S60 5.0 |
|
42 * @param s size of the allocation |
|
43 * @return void* pointer to allocated object. |
|
44 */ |
|
45 OSN_IMPORT void* operator new(size_t s,newarg) throw (std::bad_alloc); |
|
46 |
|
47 /** |
|
48 * Overloaded operator delete. |
|
49 * |
|
50 * @since S60 5.0 |
|
51 * @param ptr pointer to the object to be deleted |
|
52 */ |
|
53 OSN_IMPORT void operator delete(void* ptr,newarg)throw(); |
|
54 |
|
55 /** |
|
56 * Overloaded operator new[]. |
|
57 * |
|
58 * @since S60 5.0 |
|
59 * @param s size of the allocation |
|
60 * @return void* pointer to allocated object. |
|
61 */ |
|
62 OSN_IMPORT void* operator new[] (size_t s,newarg) throw (std::bad_alloc); |
|
63 |
|
64 /** |
|
65 * Overloaded operator delete[]. |
|
66 * |
|
67 * @since S60 5.0 |
|
68 * @param ptr pointer to the object to be deleted |
|
69 */ |
|
70 OSN_IMPORT void operator delete[](void* ptr,newarg)throw(); |
|
71 |
|
72 |
|
73 #endif // OSNNEW_H |
|