Commit Graph

7 Commits

Author SHA1 Message Date
a8423ca80f refactor: Changed align_arena to arena_align and changed signatrue, added arena_calculate_capacity
I need to assure that capacity is enough, i mean, for something like
an array just doubling size is good because you are storing things
that are the same size but for something like an arena you could actually
store anything so we need to make sure the growth factor stays cool while
an overflow doesn't occur, that's why the change with arena_calculate_capacity
and also changing signatrues to use results, A LOT of boilerplate but
i guess is fine for me.
2026-03-29 20:59:32 -06:00
00942d3bd6 feat: Added arena_push and arena_realloc
decided that arena_push will handle everything, will use alloc then push into it,
also, used realloc as a separate function for better handling resize and shit, next
is creating a save function that calculates the size needed for the element
and if it's too fucking much then throw an error. A bit overkill but yeah, i'm like
that all the time, this is suppossed to be a library to support my calculator like
damn but ok.
2026-03-29 19:06:49 -06:00
cde457593e feat: Added arena_alloc
Added arena_alloc and decided to change the arena pointer type from void *
to uint8_t * because i need to support 1 byte pointer arithmetic, thought of
using uintptr_t but not sure, the support seems really weird from what i read
online so i'm sticking with good old uint8_t * (wich i know works).
2026-03-29 18:35:13 -06:00
47c0a04166 feat and fix: Made arena_init use malloc and added arena_destroy
Realized that if i want to use malloc and free i either have to make some
sort of interface that lets you use a custom allocator and deallocator
or just use them by default. Maybe later it would be cool to change it
to that but for now is out of the scope of my project.

# Tipos:
# feat, fix, refactor, docs, style, test, chore
2026-03-29 18:00:57 -06:00
d95d7f2b51 feat(arena.c): Added arena init and added ArenaResult
Want to handle errors with results, even if it meas boilerplate
2026-03-29 17:53:10 -06:00
e8270791a4 feat(header): added signatures for devolping further functions 2026-03-29 17:30:01 -06:00
b75d1f831c Initial commit 2026-03-29 10:40:09 -06:00