Commit Graph

21 Commits

Author SHA1 Message Date
14eef43f8c refactor: Changed SizeResult to ArenaSizeResult 2026-04-11 21:19:16 -06:00
54522fece5 delete: Deleted helper utility funcitons 2026-04-11 21:17:38 -06:00
15b5cc382f test/refactor: changed things for working with more edge cases 2026-04-11 21:15:31 -06:00
d069a108ce test: Added a buch of tests, also fixes :) 2026-04-11 18:21:40 -06:00
6cea0ddf25 test: Added further testing and fixed functions for edge cases 2026-04-11 11:30:04 -06:00
19a6faf40f test: Tested new ArenaPointerDefinition 2026-04-10 21:09:51 -06:00
121261e24b refactor: Modified ArenaPointer
ArenaPointer now contains a reference to the original arena and an
offset instad of a raw address. Change was made to avoid invalidating
addresses and keeping a more consise system. arena_unwrap_pointer was
also included as a helper function.
2026-04-10 20:54:02 -06:00
cf848f2e37 refactor: Changed Result types return sytaxis 2026-04-03 15:57:54 -06:00
a207018511 fix: Moved padding declaration in arena_ensure_capacity
descripcion mas detallada
2026-04-03 12:51:49 -06:00
0c2e819c2b refactor(all): Fixed alloc and moved growing logic to another function
OK, so evrything was a fucknig mess, it still kinda is, AI helped
me to clean my own mess, it really sucks but the fucking debugger
and address sanitizer were not working, also, there were small
small errors so no big deal but still, a bit sad, also changed a
the way i cast from uint8_t to double and int in the tests, may
change that i guess, verything else i might say is good :)
2026-04-03 12:44:01 -06:00
39dfded924 test and rework: Added push test and cahnged arena_push return
So added a little test that just adds 3 ints to an arena, nothing much
but the basics work, also changed arena_push because it only pushed and
didn't returned a ponter (wich is fucking useless) so also fixed that,
everything seems fine now, need more tests.

# Tipos:
# feat, fix, refactor, docs, style, test, chore
2026-03-31 19:15:37 -06:00
0401069a63 feat and refactor: Added mult_size_t_safe and changed how new capacity is calculated for an arena
I wanted to separate things but i was getting confused on how exactly to do it
so i did the best i could, just multiply everithing by 2 and if it overflows then
well, return error, should be enough for most cases to be honest
2026-03-30 11:26:05 -06:00
d6b613df10 feat: Added align_arena_offset
Added it, it should work, no testing by now so damn, but its fine,
used aformula from stack overflow :)
2026-03-29 21:08:34 -06:00
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
9e9875de6b fix(.gitignore): Changed gitignore to ignore text files for commit messages
# Tipos:
# feat, fix, refactor, docs, style, test, chore
2026-03-29 17:42:17 -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