author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 07 Jan 2010 13:31:38 +0200 | |
changeset 26 | cb62a4f66ebe |
parent 25 | 0ed94ceaa377 |
child 35 | 1f3c3f2f5b0a |
permissions | -rw-r--r-- |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
16 |
* |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
17 |
*/ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
18 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
19 |
// INCLUDE FILES |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
20 |
|
26
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
21 |
#include <MemoryManager.h> |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
22 |
#include "MemoryPool.h" |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
23 |
#include "FastAllocator.h" |
25
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
24 |
#include "MemoryLogger.h" |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
25 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
26 |
// CONSTANTS |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
27 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
28 |
_LIT( KMemManPanicDes, "MemMan:0" ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
29 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
30 |
// CLASS DECLARATION |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
31 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
32 |
// initializing a global memory pool. |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
33 |
static CMemoryPool *s_pool = 0; |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
34 |
|
5 | 35 |
|
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
36 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
37 |
// Pool() - a utility function for accessing the right memory pool |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
38 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
39 |
inline CMemoryPool* Pool() |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
40 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
41 |
if( !s_pool ) { |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
42 |
// applications using fast memory pool already created the pool at |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
43 |
// startup. |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
44 |
s_pool = new CDefaultMemoryPool(); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
45 |
s_pool->Create(); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
46 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
47 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
48 |
return s_pool; |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
49 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
50 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
51 |
//----------------------------------------------------------------------------- |
25
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
52 |
// MemoryManager::CreateAllocator |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
53 |
//----------------------------------------------------------------------------- |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
54 |
EXPORT_C void MemoryManager::CreateFastAllocator() |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
55 |
{ |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
56 |
// create the right memory pool |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
57 |
MEM_LOGF(_L8("MemoryManager::CreateFastAllocator - s_pool=%x"), s_pool); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
58 |
#ifdef __NEW_ALLOCATOR__ |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
59 |
CMemoryPool *pool = new CNewSymbianHeapPool(); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
60 |
pool->Create(); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
61 |
RSymbianDlAllocatorWrapper* allocator = new RSymbianDlAllocatorWrapper((CNewSymbianHeapPool*)pool); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
62 |
MEM_LOGF(_L8("MemoryManager::CreateFastAllocator - new pool=%x, allocator=%x"), pool, allocator); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
63 |
User::SwitchAllocator(allocator); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
64 |
#endif |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
65 |
} |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
66 |
|
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
67 |
//----------------------------------------------------------------------------- |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
68 |
// MemoryManager::InitAllocator |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
69 |
//----------------------------------------------------------------------------- |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
70 |
EXPORT_C void MemoryManager::InitFastAllocator() |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
71 |
{ |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
72 |
// Initialize s_pool variable from current allocator, assumption is that main program has already called CreateAllocator() |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
73 |
// It is special case when this allocator is created in SetupThreadHeap() where can not initialize static data. It also |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
74 |
// solves problems due to static data destruction in Symbian 9.5. |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
75 |
#ifdef __NEW_ALLOCATOR__ |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
76 |
RAllocator &aAllocator = User::Allocator(); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
77 |
RSymbianDlAllocatorWrapper* allocator = (RSymbianDlAllocatorWrapper*) &aAllocator; |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
78 |
s_pool = allocator->iPool; |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
79 |
MEM_LOGF(_L8("MemoryManager::InitFastAllocator - s_pool=%x, allocator=%x"), s_pool, allocator); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
80 |
#endif |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
81 |
} |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
82 |
|
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
83 |
//----------------------------------------------------------------------------- |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
84 |
// MemoryManager::SwitchToFastAllocator |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
85 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
86 |
EXPORT_C RAllocator* MemoryManager::SwitchToFastAllocator() |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
87 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
88 |
// create the right memory pool |
25
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
89 |
//__ASSERT_DEBUG( s_pool == 0, User::Panic( KMemManPanicDes, 0 ) ); |
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
90 |
MEM_LOGF(_L8("MemoryManager::SwitchToFastAllocator - s_pool=%x"), s_pool); |
1
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
91 |
#ifdef __NEW_ALLOCATOR__ |
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
92 |
s_pool = new CNewSymbianHeapPool(); |
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
93 |
s_pool->Create(); |
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
94 |
RSymbianDlAllocatorWrapper* allocator = new RSymbianDlAllocatorWrapper((CNewSymbianHeapPool*)s_pool); |
25
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
95 |
MEM_LOGF(_L8("MemoryManager::SwitchToFastAllocator - new s_pool=%x"), s_pool); |
1
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
96 |
return User::SwitchAllocator( allocator ); |
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
97 |
#else |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
98 |
s_pool = new CFastMemoryPool(); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
99 |
s_pool->Create(); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
100 |
RFastAllocator* allocator = new RFastAllocator((CFastMemoryPool*)s_pool); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
101 |
return User::SwitchAllocator( allocator ); |
1
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
102 |
#endif |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
103 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
104 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
105 |
//----------------------------------------------------------------------------- |
26
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
106 |
// MemoryManager::InitOOMHandler |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
107 |
//----------------------------------------------------------------------------- |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
108 |
EXPORT_C void MemoryManager::InitOOMDialog() |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
109 |
{ |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
110 |
#ifdef __NEW_ALLOCATOR__ |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
111 |
if (s_pool) |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
112 |
{ |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
113 |
((CNewSymbianHeapPool *)s_pool)->InitOOMDialog(); |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
114 |
} |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
115 |
#endif |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
116 |
} |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
117 |
|
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
118 |
//----------------------------------------------------------------------------- |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
119 |
// MemoryManager::ResetOOMDialogDisplayed |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
120 |
//----------------------------------------------------------------------------- |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
121 |
EXPORT_C void MemoryManager::ResetOOMDialogDisplayed() |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
122 |
{ |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
123 |
#ifdef __NEW_ALLOCATOR__ |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
124 |
if (s_pool) |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
125 |
{ |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
126 |
((CNewSymbianHeapPool *)s_pool)->ResetOOMDialogDisplayed(); |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
127 |
} |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
128 |
#endif |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
129 |
} |
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
130 |
|
cb62a4f66ebe
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
25
diff
changeset
|
131 |
//----------------------------------------------------------------------------- |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
132 |
// MemoryManager::CloseFastAllocator |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
133 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
134 |
EXPORT_C void MemoryManager::CloseFastAllocator(RAllocator* aDefaultAllocator) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
135 |
{ |
1
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
136 |
#ifdef __NEW_ALLOCATOR__ |
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
137 |
RAllocator* allocator = User::SwitchAllocator( aDefaultAllocator ); |
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
138 |
delete (RSymbianDlAllocatorWrapper*)(allocator); |
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
139 |
#else |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
140 |
RAllocator* allocator = User::SwitchAllocator( aDefaultAllocator ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
141 |
delete (RFastAllocator*)(allocator); |
1
7c90e6132015
Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
0
diff
changeset
|
142 |
#endif |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
143 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
144 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
145 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
146 |
// MemoryManager::AddCollector |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
147 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
148 |
EXPORT_C void MemoryManager::AddCollector( MMemoryCollector* aCollector ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
149 |
{ |
25
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
150 |
MEM_LOGF(_L8("MemoryManager::AddCollector - s_pool=%x"), s_pool); |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
151 |
Pool()->AddCollector( aCollector ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
152 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
153 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
154 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
155 |
// MemoryManager::RemoveCollector |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
156 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
157 |
EXPORT_C void MemoryManager::RemoveCollector( MMemoryCollector* aCollector ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
158 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
159 |
Pool()->RemoveCollector( aCollector ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
160 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
161 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
162 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
163 |
// MemoryManager::AddStopper |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
164 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
165 |
EXPORT_C void MemoryManager::AddStopper( MOOMStopper* aStopper ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
166 |
{ |
25
0ed94ceaa377
Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
167 |
MEM_LOGF(_L8("MemoryManager::AddStopper - s_pool=%x"), s_pool); |
0
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
168 |
Pool()->AddStopper( aStopper ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
169 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
170 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
171 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
172 |
// MemoryManager::RemoveStopper |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
173 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
174 |
EXPORT_C void MemoryManager::RemoveStopper( MOOMStopper* aStopper ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
175 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
176 |
Pool()->RemoveStopper( aStopper ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
177 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
178 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
179 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
180 |
// MemoryManager::SetNotifier |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
181 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
182 |
EXPORT_C void MemoryManager::SetNotifier( MOOMNotifier* aNotifier ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
183 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
184 |
Pool()->SetNotifier( aNotifier ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
185 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
186 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
187 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
188 |
// MemoryManager::PreCheck |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
189 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
190 |
EXPORT_C TBool MemoryManager::PreCheck( TUint aTotalSize, TUint aMaxBufSize, const TDesC8& aChecker ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
191 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
192 |
return Pool()->PreCheck( aTotalSize, aMaxBufSize, aChecker ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
193 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
194 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
195 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
196 |
// MemoryManager::PostCheck |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
197 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
198 |
EXPORT_C TUint MemoryManager::PostCheck() |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
199 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
200 |
return Pool()->PostCheck(); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
201 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
202 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
203 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
204 |
// MemoryManager::SetStatus |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
205 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
206 |
EXPORT_C void MemoryManager::SetStatus( TOOMCheckResult aType ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
207 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
208 |
Pool()->SetStatus( aType ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
209 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
210 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
211 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
212 |
// MemoryManager::Status |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
213 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
214 |
EXPORT_C TUint MemoryManager::Status() |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
215 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
216 |
return Pool()->Status(); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
217 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
218 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
219 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
220 |
// MemoryManager::FreeRam |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
221 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
222 |
EXPORT_C void MemoryManager::FreeRam() |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
223 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
224 |
Pool()->CollectMemory(); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
225 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
226 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
227 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
228 |
// MemoryManager::RestoreCollectors |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
229 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
230 |
EXPORT_C void MemoryManager::RestoreCollectors() |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
231 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
232 |
Pool()->RestoreCollectors(EOOM_PriorityLow); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
233 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
234 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
235 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
236 |
// MemoryManager::SetRescueBufferSize |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
237 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
238 |
EXPORT_C void MemoryManager::SetRescueBufferSize( TInt aSize ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
239 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
240 |
Pool()->SetRescueBufferSize( aSize ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
241 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
242 |
|
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
243 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
244 |
// MemoryManager::MemorySize |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
245 |
//----------------------------------------------------------------------------- |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
246 |
EXPORT_C TUint MemoryManager::MemorySize( TAny* aPtr ) |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
247 |
{ |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
248 |
return Pool()->MemorySize( aPtr ); |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
249 |
} |
dd21522fd290
Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
250 |