summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-01-02add basic hashmap implementation.Jake Koroman
2025-12-17fix formatting.Jake Koroman
2025-11-18fix arena_resize bug and fix jrk_array_foreach macro.Jake Koroman
2025-11-11add jrk_array_foreach.Jake Koroman
2025-11-09add JRK_DEFAULT_ARRAY_FREE_FN.Jake Koroman
2025-10-31complete overhaul of dynamic arrays and no more shortnames.Jake Koroman
Dynamic arrays now are created with jrk_array_prototype and jrk_array_impl macros. The header includes one predefined array of char for the jrk_StringBuilder api. This new api embeds allocation related functions in the struct. This allows for easy integration with any allocator you choose however it comes at the cost of three extra pointers in the struct. If the pointers are NULL the allocs will call the default allocators, see JRK_ARRAY_DEFAULT_ALLOC_FN and JRK_ARRAY_DEFAULT_REALLOC_FN macros. Also no more shortnames, don't be lazy :). This change prioritizes code readability.
2025-10-30jrk.h: update prev_offset in arena_resize, and always init the memory.Jake Koroman
2025-10-28update POSIX calls to log errno on error.Jake Koroman
2025-10-28remove most jrk_die paths.Jake Koroman
Most functions will never crash the program now. StringBuilder and da functions can still cause crashes. I am okay with allowing these to crash as I am okay with assuming mallocs/reallocs will never fail, which isn't ideal. Properly fixing this requires some major changes to the da_rerserve functions as I cannot figure out a way to properly propagate errors out of those macros. See the arena_da/sb macros on how I did it for those. But the api isn't consistent. Some calls you can directly test against the functions return value and others you have to manually check the pointer after calling the macro. I wish I could figure out a better way of doing this, but for now it will do.
2025-10-27jrk.h: jrk_arena functions converted.Jake Koroman
2025-10-15fix jrk_elog macros to also print errno message.Jake Koroman
2025-10-15jrk_assert always exits.Jake Koroman
2025-10-06add JRK_NO_EXIT_ON_DIE for better control of error handling.Jake Koroman
Most failing functions now return bool and log their errors if JRK_NO_EXIT_ON_DIE is defined. This will make integration with codebases much easier. No longer will the program hard crash because of an internal jrk.h error. Also, you can now overwrite all die and log macros.
2025-09-26fix pedantic warnings.Jake Koroman
2025-09-22remove jrk_die from JRK_IMPLEMENTATION block.Jake Koroman
2025-09-22add jrk_arena_push_strf.Jake Koroman
2025-09-16jrk_Arena fixups.Jake Koroman
2025-09-12overhaul of jrk_Arena.Jake Koroman
2025-09-09add jrk_return_defer and remove assert from jrk_da_free.Jake Koroman
2025-09-02remove jrk_arena_expand.Jake Koroman
Wasn't properly implemented. When reallocing all pointers are invalidated. To properly implement growing I will need to either have a way of updating all pointers or treating the arena as a linked list. Pointers could also be indexes into the arena data array but then we lose pointer syntax. Not sure the best way to implement this. I don't have a use for growing arenas at the moment so this is a low priority.
2025-09-02add jrk_tmpstrings api.Jake Koroman
2025-09-02fix array out of bounds access.Jake Koroman
2025-08-29add jrk_sb_append_buf_at.Jake Koroman
2025-08-27add assertv. change jrk_Arena length to count.Jake Koroman
2025-08-22add JRK_ARRSIZE.Jake Koroman
2025-08-22add jrk_sv_chop_delim.Jake Koroman
2025-08-12add JRK_UNUSED and jrk_shift.Jake Koroman
2025-08-05add jrk_(e)diev macros. much better error tracing.Jake Koroman
2025-08-05add jrk_sb_read_entire_file.Jake Koroman
2025-08-05fix copy and paste mistake.Jake Koroman
2025-08-05code cleanup.Jake Koroman
2025-07-31add todos, jrk_sb_write_file and formatting.Jake Koroman
2025-07-31implement jrk_StringView.Jake Koroman
2025-07-31add jrk_fd functions.Jake Koroman
2025-07-30formatting changes.Jake Koroman
2025-07-29add do while to jrk_da_free macro.Jake Koroman
2025-07-28rip tabs.Jake Koroman
2025-07-28remove jrk_string in favour of jrk_StringBuilder api.Jake Koroman
2025-07-28completely reworked dynamic array api design.Jake Koroman
2025-07-25add jrk_emalloc macro.Jake Koroman
2025-07-23jrk_arena_create use jrk_ecalloc.Jake Koroman
2025-07-23add jrk_string_to_cstr_arena.Jake Koroman
2025-07-23add jrk_ecalloc and jrk_erealloc.Jake Koroman
2025-07-22add missing forward decls.Jake Koroman
2025-07-22fix grammar.Jake Koroman
2025-07-22add jrk_rand_num and jrk_rand_num_range.Jake Koroman
2025-07-21Ready. Set. Go!Jake Koroman