Skip to content
Snippets Groups Projects
Commit 8a9d1fa9 authored by Niels Möller's avatar Niels Möller
Browse files

(xalloc): New function.

Rev: nettle/tools/misc.c:1.3
Rev: nettle/tools/misc.h:1.3
parent a538a476
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,19 @@ werror(const char *format, ...) ...@@ -50,6 +50,19 @@ werror(const char *format, ...)
va_end(args); va_end(args);
} }
void *
xalloc(size_t size)
{
void *p = malloc(size);
if (!p)
{
fprintf(stderr, "Virtual memory exhausted.\n");
abort();
}
return p;
}
const char const char
sexp_token_chars[0x80] = sexp_token_chars[0x80] =
{ {
......
...@@ -43,6 +43,9 @@ werror(const char *format, ...) ...@@ -43,6 +43,9 @@ werror(const char *format, ...)
#endif #endif
; ;
void *
xalloc(size_t size);
enum sexp_mode enum sexp_mode
{ {
SEXP_CANONICAL = 0, SEXP_CANONICAL = 0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment