xml/libxml2libs/inc/xmlengineutils/xmlengmem.h
changeset 0 e35f40988205
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 // Copyright (c) 2005-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 "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 // This file contains definitions that are related 
       
    15 // to memory mangement and OOM detection
       
    16 //
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @publishedPartner
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef XMLENGMEM_H
       
    27 #define XMLENGMEM_H
       
    28 
       
    29 #include <e32base.h>
       
    30 
       
    31 /**
       
    32 Checks whether the OOM flag was set.  If the OOM flag is set, it is cleared and 
       
    33 the function leaves with KErrNoMemory.
       
    34 @leave KErrNoMemory OOM flag was set
       
    35 */
       
    36 IMPORT_C void XmlEngOOMTestL();
       
    37 
       
    38 /**
       
    39 Resets the OOM flag and leaves with KErrNoMemory
       
    40 @leave KErrNoMemory This function always leaves
       
    41 */
       
    42 IMPORT_C void XmlEngLeaveOOML();
       
    43 
       
    44 /** Memory handling macros */
       
    45 #define OOM_IF_NULL(condition)  if (condition) {} else OOM_HAPPENED
       
    46 #define OOM_IF(condition)       if (!(condition)) {} else OOM_HAPPENED
       
    47 #define TEST_OOM_FLAG           XmlEngOOMTestL(); 
       
    48 #define OOM_HAPPENED            XmlEngLeaveOOML()
       
    49 
       
    50 #endif /* XMLENGMEM_H */