Skip to content

Commit 317bc38

Browse files
committed
Add mb-cheat so you can see how it works.
1 parent 2fa4689 commit 317bc38

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

fundamentals3x/mb-cheat.c

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include "membench.h"
2+
#include <stdlib.h>
3+
#include <assert.h>
4+
5+
static chunk the_only_chunk;
6+
7+
membench_arena* membench_arena_new(void) {
8+
return NULL;
9+
}
10+
11+
chunk* membench_alloc(membench_arena* arena) {
12+
(void) arena;
13+
return &the_only_chunk;
14+
}
15+
16+
void membench_free(membench_arena* arena, chunk* x) {
17+
(void) arena, (void) x;
18+
}
19+
20+
void membench_arena_free(membench_arena* arena) {
21+
(void) arena;
22+
}

0 commit comments

Comments
 (0)