blob: ff512df532c50fe2d2eaf1b4265549b07de182af (
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 COPYING.
*/
#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;
}
|