summaryrefslogtreecommitdiff
path: root/src/lib/mpmalloc.cc
blob: db4a87a7f9fe21d50bf6a080ba42d7e9700e37d5 (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
#include <stdlib.h>
#include "driver/stdout.h"
#include "lib/mpmalloc.h"

void* mpcalloc(size_t nmemb, size_t size) {
	void* ret = calloc(nmemb, size);
#ifdef ADDR_20BIT
	kout << "calloc:" << dec << (uint32_t)nmemb << "x" << (uint32_t)size << "@" << ret << endl;
#else
	kout << "calloc:" << dec << nmemb << "x" << size << "@" << ret << endl;
#endif
	return ret;
}

void* mpmalloc(size_t size) {
	void* ret = malloc(size);
#ifdef ADDR_20BIT
	kout << "malloc:" << dec << (uint32_t)size << "@" << ret << endl;
#else
	kout << "malloc:" << dec << size << "@" << ret << endl;
#endif
	return ret;
}

void mpfree(void* addr) {
	kout << "free:" << addr << endl;
	free(addr);
}