Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Base class for all objects created by backend
24 class BBase : public CBase
33 /* *****************************************************************
34 Overloading new and delete operators so that they will
35 allocate and deallocare memory from/to the private heap of backend
36 ********************************************************************/
37 inline TAny* operator new(TUint aSize, TAny* aBase) __NO_THROW
39 Mem::FillZ(aBase, aSize); return aBase;
42 inline TAny* operator new(TUint aSize) __NO_THROW
44 return Backend()->Alloc(aSize);
47 inline TAny* operator new(TUint aSize, TLeave)
49 TAny* ptr = Backend()->Alloc(aSize);
52 User::Leave(KErrNoMemory);
57 inline TAny* operator new(TUint aSize, TUint aExtraSize) __NO_THROW
59 return Backend()->Alloc(aSize + aExtraSize);
62 inline TAny* operator new(TUint aSize, TLeave, TUint aExtraSize)
64 TAny* ptr = Backend()->Alloc(aSize + aExtraSize);
67 User::Leave(KErrNoMemory);
72 /*corresponding overloaded delete operators */
74 inline void operator delete(TAny *aPtr, TAny*) __NO_THROW
76 Backend()->Free( aPtr );
79 inline void operator delete(TAny *aPtr) __NO_THROW
81 Backend()->Free( aPtr );
84 inline void operator delete(TAny *aPtr, TLeave)
86 Backend()->Free( aPtr );
89 inline void operator delete(TAny *aPtr, TUint) __NO_THROW
91 Backend()->Free( aPtr );
94 inline void operator delete(TAny *aPtr, TLeave, TUint)
96 Backend()->Free( aPtr );
99 static void Delete(BBase* aPtr)
106 virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
109 return KErrExtensionNotSupported;
114 BBase& operator=(const CBase&);