You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
871 B
39 lines
871 B
//+-------------------------------------------------------------------------
|
|
//
|
|
// Microsoft Windows
|
|
//
|
|
// Copyright (C) Microsoft Corporation, 1996 - 1999
|
|
//
|
|
// File: new.cpp
|
|
//
|
|
// Contents: new and delete operators.
|
|
//
|
|
// History: 16-Jan-97 kevinr created
|
|
//
|
|
//--------------------------------------------------------------------------
|
|
|
|
#include "global.hxx"
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
//
|
|
//--------------------------------------------------------------------------
|
|
extern void * __cdecl operator new(
|
|
IN size_t cb)
|
|
{
|
|
void *pv;
|
|
if (NULL == (pv = malloc(cb)))
|
|
goto mallocError;
|
|
ErrorReturn:
|
|
return pv;
|
|
SET_ERROR(mallocError,ERROR_NOT_ENOUGH_MEMORY)
|
|
}
|
|
|
|
void __cdecl operator delete(
|
|
IN void *pv)
|
|
{
|
|
if (pv)
|
|
free(pv);
|
|
}
|
|
|
|
|