analyzetool/dynamicmemoryhook/inc/analyzetoolmemoryallocator.h
branchRCL_3
changeset 13 da2cedce4920
equal deleted inserted replaced
12:d27dfa8884ad 13:da2cedce4920
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Declaration of the class RAnalyzeToolMemoryAllocator.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ANALYZETOOLMEMORYALLOCATOR_H
       
    20 #define ANALYZETOOLMEMORYALLOCATOR_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <u32std.h>
       
    24 #include "threadstack.h"
       
    25 #include "../../symbian_version.hrh"
       
    26 
       
    27 // CONSTANTS
       
    28 #if ( SYMBIAN_VERSION_SUPPORT >= SYMBIAN_3 )
       
    29     #ifndef __WINS__
       
    30     const TInt KDummyHandle = -1000;
       
    31     #endif
       
    32 #endif
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  Abstract class for basic RAnalyzeToolMemoryAllocator funtions
       
    38 */
       
    39 class RAnalyzeToolMemoryAllocator : public RAllocator
       
    40     {
       
    41     public:
       
    42     
       
    43         /**
       
    44         * C++ default constructor.
       
    45         * @param aNotFirst Is this first thread using this heap
       
    46         */   
       
    47         RAnalyzeToolMemoryAllocator( TBool aNotFirst );
       
    48         
       
    49         /**
       
    50         * Destructor.
       
    51         */  
       
    52         //lint -e{1510} suppress "base class 'RAllocator' has no destructor"    
       
    53         virtual ~RAnalyzeToolMemoryAllocator();
       
    54         
       
    55         /**
       
    56         * Uninstall the RAnalyzeToolMemoryAllocator
       
    57         */
       
    58         virtual void Uninstall() = 0;
       
    59         
       
    60         /**
       
    61         * Shares the heap for another thread
       
    62         */
       
    63         virtual void ShareHeap() = 0;
       
    64 
       
    65     protected:
       
    66 
       
    67         /**
       
    68          * Switch original allocator in use.
       
    69          * Switches original allocator in use if not already.
       
    70          */
       
    71         void SwitchOriginalAllocator();
       
    72         
       
    73         /**
       
    74          * Checks is the given address in loaded code memory area.
       
    75          */
       
    76         inline bool IsAddressLoadedCode( TUint32& aAddress );
       
    77         
       
    78         /* The original thread RAllocator */
       
    79         RAllocator* iAllocator;
       
    80         
       
    81         /* Is this the first thread using this heap */
       
    82         TBool iNotFirst;   
       
    83 
       
    84         /* Memorymodel */
       
    85         TUint32 iMemoryModel;
       
    86         
       
    87     };
       
    88 
       
    89 // INLINES
       
    90 #include "analyzetoolmemoryallocator.inl"
       
    91 
       
    92 #endif // ANALYZETOOLMEMORYALLOCATOR_H
       
    93 
       
    94 // End of File