projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ce958d
)
(xmalloc): New function.
author
Richard Stallman
<rms@gnu.org>
Tue, 28 Sep 1993 23:23:24 +0000
(23:23 +0000)
committer
Richard Stallman
<rms@gnu.org>
Tue, 28 Sep 1993 23:23:24 +0000
(23:23 +0000)
From-SVN: r5521
gcc/bi-opcode.c
patch
|
blob
|
history
diff --git
a/gcc/bi-opcode.c
b/gcc/bi-opcode.c
index 772b1fed3add8ffcbdfc346836800f520fd87778..f453789dd4d6b62644cc253eafe2993b6ee18437 100644
(file)
--- a/
gcc/bi-opcode.c
+++ b/
gcc/bi-opcode.c
@@
-51,3
+51,20
@@
enum bytecode_opcode\n{");
return 0;
}
+
+/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
+ memory. */
+char *
+xmalloc (nbytes)
+ int nbytes;
+{
+ char *tmp = (char *) malloc (nbytes);
+
+ if (!tmp)
+ {
+ fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
+ exit (1);
+ }
+
+ return tmp;
+}