summaryrefslogtreecommitdiff
path: root/avr/xmalloc.c
blob: d42d5c9237eb604780f02b3bd54e0ca15049ff7b (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
29
30
31
32
/*
 * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#include <stdlib.h>
#include "debug.h"
#include "xmalloc.h"

void* xmalloc(size_t size)
{
	void *p;

	p = malloc(size);

	if (p == NULL)
		debug("*** Out of memory!\n");

	return p;
}


void* xrealloc(void *p, size_t size)
{
	p = realloc(p, size);

	if (p == NULL)
		debug("*** Out of memory!\n");

	return p;
}