[Common-cvs] system/pub/platform/symbian memorymonitor.h,NONE,1.1

[Common-cvs] system/pub/platform/symbian memorymonitor.h,NONE,1.1

gashish at helixcommunity.org gashish at helixcommunity.org
Tue Nov 22 12:23:08 PST 2005


Update of /cvsroot/common/system/pub/platform/symbian
In directory cvs:/tmp/cvs-serv7848

Added Files:
	memorymonitor.h 
Log Message:
Synopsis: Handle out of memory error

"Nokia is bound by the terms of a commercial contribution agreement with RealNetworks, and I am authorized to contribute this code under said agreement."

Modified by: ashish.as.gupta at nokia.com

Error ID: TSW ID=EOVL-6GWTZX

Reviewed by: 

Date: 11-17-2005.

Project: Helix plugin for Symbian

Synopsis: Handle out of memory error

Overloaded new operator calls User::Leave on memory allocation failure. This is incorrect as code may not be running under TRAP. This results in panics.

Following modifications are made:

1. Change overloaded operators so that User::Leave is not called. Functions should not leave 
unless they are trapped by higher level code.

2. A new class SymbianMemoryMonitor is added that receives an event from the "new" and 
other similar overloaded operators. On receiving the event, IHXErrorMessages API will 
report an error to engine. Ideally, whenever a memory allocation API returns an error, 
requester should handle the error code but it not the case always. In many cases 
CHXBuffer::SetSize and similar APIs returned error codes are not always handled by 
their respective users.

3. SymbainMemoryMonitor is created by MMF-TLC. 

4. PrintCurrentState() is not called from so many places. It is only called when we change the state.

Files Modified: 

Image Size and Heap Use impact: minor

Platforms and Profiles Build Verified: helix-client-s60-mmf-basic, armv5

Platforms and Profiles Functionality verified: armv5

Branch: HEAD



--- NEW FILE: memorymonitor.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef SYMBIAN_MEMORY_MONITOR_H
#define SYMBIAN_MEMORY_MONITOR_H

#include "globals/hxglobals.h"
#include "hxerror.h"

class SymbianMemoryMonitor
{
private:

    SymbianMemoryMonitor();

public:
    enum MemoryEvent
    {
        EOutOfMemory = 0,
    };

    static SymbianMemoryMonitor*  Instance();
    ~SymbianMemoryMonitor();

    HXBOOL  Init(IUnknown *pContext);
    void    SendEvent(MemoryEvent event);
    
private:
    IHXErrorMessages*       m_pErrorMessages;
};

#endif SYMBIAN_MEMORY_MONITOR_H





More information about the Common-cvs mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.