symport/symuser/new.cpp
changeset 1 0a7b44b10206
child 2 806186ab5e14
equal deleted inserted replaced
0:c55016431358 1:0a7b44b10206
       
     1 // Copyright (c) 1995-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 the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "e32std.h"
       
    17 
       
    18 EXPORT_C TAny* operator new(TUint aSize) __NO_THROW
       
    19 //
       
    20 // The global new operator.
       
    21 //
       
    22 	{
       
    23 	return User::Alloc(aSize);
       
    24 	}
       
    25 
       
    26 EXPORT_C TAny* operator new[](TUint aSize) __NO_THROW
       
    27     {
       
    28     return User::Alloc(aSize);
       
    29     }
       
    30 
       
    31 EXPORT_C TAny* operator new(TUint aSize, TUint aExtraSize) __NO_THROW
       
    32 //
       
    33 // Allocate the requested size plus the extra.
       
    34 //
       
    35 	{
       
    36 	return  User::Alloc(aSize + aExtraSize);
       
    37 	}
       
    38 
       
    39 EXPORT_C void operator delete(TAny* aPtr) __NO_THROW
       
    40 //
       
    41 // The replacement delete operator.
       
    42 //
       
    43 	{
       
    44 	User::Free(aPtr);
       
    45 	}
       
    46 
       
    47 EXPORT_C void operator delete[](TAny* aPtr) __NO_THROW
       
    48     {
       
    49     User::Free(aPtr);
       
    50     }