os/kernelhwsrv/kernel/eka/common/gcchelp.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/common/gcchelp.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,84 @@
     1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32\common\gcchelp.cpp
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include "common.h"
    1.22 +#ifdef __KERNEL_MODE__
    1.23 +#include <kernel/kernel.h>
    1.24 +#endif
    1.25 +
    1.26 +#ifndef __X86__ // the declarations in this block are done elsewhere on x86
    1.27 +
    1.28 +EXPORT_C TAny* operator new(TUint aSize) __NO_THROW
    1.29 +//
    1.30 +// The global new operator.
    1.31 +//
    1.32 +	{
    1.33 +
    1.34 +	return STD_CLASS::Alloc(aSize);
    1.35 +	}
    1.36 +
    1.37 +EXPORT_C TAny* operator new[](TUint aSize) __NO_THROW
    1.38 +    {
    1.39 +
    1.40 +    return STD_CLASS::Alloc(aSize);
    1.41 +    }
    1.42 +
    1.43 +EXPORT_C TAny* operator new(TUint aSize, TUint aExtraSize) __NO_THROW
    1.44 +//
    1.45 +// Allocate the requested size plus the extra.
    1.46 +//
    1.47 +	{
    1.48 +
    1.49 +	return  STD_CLASS::Alloc(aSize + aExtraSize);
    1.50 +	}
    1.51 +
    1.52 +EXPORT_C void operator delete(TAny* aPtr) __NO_THROW
    1.53 +//
    1.54 +// The replacement delete operator.
    1.55 +//
    1.56 +	{
    1.57 +
    1.58 +	STD_CLASS::Free(aPtr);
    1.59 +	}
    1.60 +
    1.61 +EXPORT_C void operator delete[](TAny* aPtr) __NO_THROW
    1.62 +    {
    1.63 +
    1.64 +	STD_CLASS::Free(aPtr);
    1.65 +    }
    1.66 +
    1.67 +#endif //!defined(__X86__)
    1.68 +
    1.69 +#ifdef __ARMCC__
    1.70 +
    1.71 +EXPORT_C TAny* operator new(TUint aSize, const std::nothrow_t& aNoThrow) __NO_THROW
    1.72 +//
    1.73 +// The global new operator.
    1.74 +//
    1.75 +	{
    1.76 +	(void)aNoThrow;
    1.77 +	return STD_CLASS::Alloc(aSize);
    1.78 +	}
    1.79 +
    1.80 +EXPORT_C TAny* operator new[](TUint aSize, const std::nothrow_t& aNoThrow) __NO_THROW
    1.81 +    {
    1.82 +    (void)aNoThrow;
    1.83 +    return STD_CLASS::Alloc(aSize);
    1.84 +    }
    1.85 +
    1.86 +#endif
    1.87 +