Skip to content

Commit

Permalink
modernise cutil/emalloc.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
jimregan committed Jul 20, 2015
1 parent 52e4c77 commit 2a1cba6
Showing 1 changed file with 22 additions and 28 deletions.
50 changes: 22 additions & 28 deletions cutil/emalloc.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/******************************************************************************
** Filename:
/**************************************************************************
* Filename:
emalloc.c
** Purpose:
** Purpose:
Routines for trapping memory allocation errors.
** Author:
** Author:
Dan Johnson
HP-UX 6.2
HP-UX 6.2
** History:
** History:
4/3/89, DSJ, Created.
**
** (c) Copyright Hewlett-Packard Company, 1988.
Expand All @@ -21,36 +21,30 @@
** See the License for the specific language governing permissions and
** limitations under the License.
******************************************************************************/
/**----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
Include Files and Type Defines
----------------------------------------------------------------------------**/
----------------------------------------------------------------------------*/
#include "emalloc.h"
#include "danerror.h"
#include <stdlib.h>

/**----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
Public Code
----------------------------------------------------------------------------**/
/*---------------------------------------------------------------------------*/
void *Emalloc(int Size) {
/*
** Parameters:
** Size
number of bytes of memory to be allocated
** Globals: none
** Operation:
** This routine attempts to allocate the specified number of
** bytes. If the memory can be allocated, a pointer to the
** memory is returned. If the memory cannot be allocated, or
** if the allocation request is negative or zero,
** an error is trapped.
** Return: Pointer to allocated memory.
** Exceptions: NOTENOUGHMEMORY
unable to allocate Size bytes
** ILLEGALMALLOCREQUEST
negative or zero request size
** History: 4/3/89, DSJ, Created.
----------------------------------------------------------------------------*/
/**
* This routine attempts to allocate the specified number of
* bytes. If the memory can be allocated, a pointer to the
* memory is returned. If the memory cannot be allocated, or
* if the allocation request is negative or zero,
* an error is trapped.
* @param Size number of bytes of memory to be allocated
* @return Pointer to allocated memory.
* @note Exceptions:
* - #NOTENOUGHMEMORY unable to allocate Size bytes
* - #ILLEGALMALLOCREQUEST negative or zero request size
* @note History: 4/3/89, DSJ, Created.
*/
void *Emalloc(int Size) {
void *Buffer;

if (Size <= 0)
Expand Down

0 comments on commit 2a1cba6

Please sign in to comment.