aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-11-01 19:08:59 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-11-01 19:08:59 +0000
commit525694bea7724d612a8b742943a0ed2aed5822f8 (patch)
tree75e43be3a94772c9abd5944e93ce57ddb5ec0902 /Makefile
parentd648344c2c5827fe46ad3097c84aa9349954895d (diff)
downloadovm-525694bea7724d612a8b742943a0ed2aed5822f8.tar.gz
ovm-525694bea7724d612a8b742943a0ed2aed5822f8.tar.bz2
ovm-525694bea7724d612a8b742943a0ed2aed5822f8.zip
Added an arena allocator
A page is a flexibly allocated structure of bytes, with a count of the number of bytes already allocated (used) and number of bytes available overall (available), with a pointer to the next page, if any. heap_t is a linked list of pages. One may allocate a requested size off the heap which causes one of two things: 1) Either a page already exists with enough space for the requested size, in which case that page's pointer is used as the base for the requested pointer 2) No pages satisfy the requested size, so a new page is allocated which is the new end of the heap.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 1115d75..f326a41 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ TERM_RESET:=$(shell echo -e "\e[0;0m")
## Lib setup
LIB_DIST=$(DIST)/lib
LIB_SRC=lib
-LIB_CODE:=$(addprefix $(LIB_SRC)/, base.c darr.c inst.c)
+LIB_CODE:=$(addprefix $(LIB_SRC)/, base.c darr.c heap.c inst.c)
LIB_OBJECTS:=$(LIB_CODE:$(LIB_SRC)/%.c=$(LIB_DIST)/%.o)
LIB_DEPS:=$(LIB_OBJECTS:%.o=%.d)
LIB_CFLAGS=$(CFLAGS)