summaryrefslogtreecommitdiff
path: root/src/common/mem.c
blob: 02bd8c5887f0ccd65a4e8c10f48271a8de094bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "common/mem.h"
#include <stdlib.h>
#include "common/error.h"

/**
 * File: error.c
 *
 * Author:
 *   Pacien TRAN-GIRARD
 */

void *malloc_or_die(size_t size) {
  void *ptr = malloc(size);

  if (ptr == NULL)
    rage_quit(OUT_OF_MEMORY_ERROR);

  return ptr;
}