Skip to content

Commit

Permalink
[CN-Exec] Add free_all for bump allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
ZippeyKeys12 committed Sep 26, 2024
1 parent 68b0b09 commit ffd0e1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/libcn/include/cn-executable/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ void *alloc_(long nbytes, const char *, int);
#define alloc(x)\
alloc_(x, __FILE__, __LINE__)

void free_all(void);

// void *alloc_zeros(long nbytes);

Expand Down
3 changes: 3 additions & 0 deletions runtime/libcn/src/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ void *alloc_(long nbytes, const char *str, int line) {
//return malloc(nbytes);
}

void free_all(void) {
curr = buf;
}

// void *alloc_zeros(long nbytes) {
// void *res = alloc(nbytes);
Expand Down

0 comments on commit ffd0e1e

Please sign in to comment.