blob: 7befc730b021715e33881439d9446ef8b34bd723 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/*
* blogc: A blog compiler.
* Copyright (C) 2014-2015 Rafael G. Martins <rafael@rafaelmartins.eng.br>
*
* This program can be distributed under the terms of the BSD License.
* See the file LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */
#include <stdlib.h>
#include <stdio.h>
#include "utils.h"
void*
b_malloc(size_t size)
{
// simple things simple!
void *rv = malloc(size);
if (rv == NULL) {
fprintf(stderr, "fatal error: Failed to allocate memory!\n");
exit(1);
}
return rv;
}
|