File: mem.c

package info (click to toggle)
swish-e 1.1-1
  • links: PTS
  • area: main
  • in suites: hamm, potato, slink
  • size: 380 kB
  • ctags: 340
  • sloc: ansic: 4,540; makefile: 77; sh: 12
file content (33 lines) | stat: -rwxr-xr-x 632 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
** Copyright (C) 1995, Enterprise Integration Technologies Corp.        
** All Rights Reserved.
** Kevin Hughes, kevinh@eit.com 
** 3/11/94
*/

#include "swish.h"
#include "mem.h"

/* Error-checking malloc()...
*/

void *emalloc(i)
     int i;
{
        void *p;
 
        if ((p = (void *) malloc(i)) == NULL)
                progerr("Ran out of memory (could not allocate enough)!");
        return p;
}

void *erealloc(ptr, i)
     void *ptr;
     int i;
{
        void *p;
 
        if ((p = (void *) realloc(ptr, i)) == NULL)
                progerr("Ran out of memory (could not reallocate enough)!");
        return p;
}