summaryrefslogtreecommitdiff
path: root/lib/heap.c
blob: 8331a173c3d571b8089edc816d8654cad9393f2b (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
33
34
35
36
37
38
39
#include <string.h>
#include <stdlib.h>

struct heap_node
{
	struct heap_node *next;
	size_t size;
};

struct heap_head
{
	struct heap_node *first;
	size_t total_bytes;
	size_t ready_bytes;
};

void *malloc(size_t size)
{
	(void)size;
	return nullptr;
}

void *calloc(size_t count, size_t size)
{
	void *block = malloc(count * size);

	if (block != nullptr)
	{
		memset(block, 0, count * size);
	}

	return block;
}

void free(void *block)
{
	(void)block;
}