mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-01-11 23:53:19 +00:00
21 lines
309 B
C
21 lines
309 B
C
/*
|
|
* emalloc.c
|
|
*/
|
|
#include <errno.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "emalloc.h"
|
|
|
|
void *emalloc(size_t nrbytes)
|
|
{
|
|
void *p;
|
|
|
|
p = malloc(nrbytes);
|
|
if (!p) {
|
|
fprintf(stderr, "malloc(%zu) failed: %s\n", nrbytes, strerror(errno));
|
|
exit(1);
|
|
}
|
|
return p;
|
|
}
|