xml/libxml2libs/src/xmlengineutils/xmlengmem.cpp
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 #include <xml/utils/xmlengxestd.h>
       
    19 #include <xml/utils/xmlengmem.h>
       
    20 #include "libxml2_globals_private.h"
       
    21 
       
    22 //---------------------------------------------------------
       
    23 // Checks whether OOM flag was set up.
       
    24 // If OOM flag is set, it is cleared and Leave occurs
       
    25 // with code KErrNoMemory
       
    26 //---------------------------------------------------------
       
    27 //
       
    28 EXPORT_C void XmlEngOOMTestL()
       
    29     {
       
    30     if (xmlOOMFlag())
       
    31         {
       
    32         XmlEngLeaveOOML();
       
    33         }
       
    34     }
       
    35 
       
    36 //--------------------------------------------------------
       
    37 // Performs leave action when OOM condition is met.
       
    38 // This is a centralized point of initiation of OOM leave
       
    39 //--------------------------------------------------------
       
    40 //
       
    41 EXPORT_C void XmlEngLeaveOOML()
       
    42     {
       
    43     xmlResetOOM(); // reset OOM flag in libxml2
       
    44     XmlEngLeaveL(KErrNoMemory);
       
    45     }
       
    46