mirror of
https://github.com/mikpe/pdp10-tools.git
synced 2026-05-03 22:49:28 +00:00
as: move old overly complex incomplete prototype to new 0LD subdir; start afresh with a minimalistic design and improve it incrementally
This commit is contained in:
20
as/0LD/emalloc.c
Normal file
20
as/0LD/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