mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-04-29 05:06:09 +00:00
Initial import
This commit is contained in:
20
as/emalloc.c
Normal file
20
as/emalloc.c
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
Reference in New Issue
Block a user