Skip to content

Commit

Permalink
restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
abxh committed Apr 16, 2024
1 parent ca83cd0 commit cc59814
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/arena.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#include "allocators/arena.h" // arena_*
#include <stdlib.h> // size_t

void* arena_alloc(arena_type* arena_p, size_t size, size_t alignment) {
if (arena_p->arena_offset + size <= arena_p->arena_buffer_length) {
void* ptr = &arena_p[arena_p->arena_offset];
arena_p->arena_offset += size;
return ptr;
}
return NULL;
}


2 changes: 1 addition & 1 deletion src/bitarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <stdlib.h> // malloc, calloc, free, size_t, NULL
#include <string.h> // memcmp, memcpy

#include "bitarray.h" // bitarray*
#include "other/bitarray.h" // bitarray*

static_assert(CHAR_BIT == 8, "a char is 8 bits.");

Expand Down
2 changes: 1 addition & 1 deletion src/strmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "is_pow2.h" // is_pow2
#include "fnvhash.h" // fnvhash
#include "strmap.h" // strmap_*, STRMAP_GET_VALUE_DEFAULT
#include "other/strmap.h" // strmap_*, STRMAP_GET_VALUE_DEFAULT

#define INITIAL_CAPACITY 16
#define MAX_CHAIN_LENGTH 5
Expand Down

0 comments on commit cc59814

Please sign in to comment.