aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/mem.c
blob: 04201ffcb03a3b02432d4db680e3413ae48e6046 (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
/*
 * 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.
 */

#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;
}