ack/lang/pc/libpc/new.c

20 lines
258 B
C
Raw Normal View History

#include <stdlib.h>
#include <em_abs.h>
#include <pc_err.h>
1984-07-20 10:44:57 +00:00
2018-06-17 14:11:29 +00:00
extern void _trp(int); /* called on error */
void _new(int n, void** ptr)
{
void* p = malloc(n);
if (!p)
_trp(EHEAP);
*ptr = p;
}
void _dis(int n, void** ptr)
{
free(*ptr);
*ptr = NULL;
}