Skip to content

Commit

Permalink
src/lib-alloc.c: refine
Browse files Browse the repository at this point in the history
fix everything first,
asserts are for later...
  • Loading branch information
Antonin Reitz committed Oct 19, 2023
1 parent f0a5f5a commit 8661f9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ uint8_t* StarMalloc_memset_u8(uint8_t* dest, uint8_t v, size_t n) {
return (uint8_t*) memset((void*) dest, v, n);
}

void* _Atomic slab_region_ptr;
static void* _Atomic slab_region_ptr;

// hm-alike initialization
static inline bool is_init(void) {
Expand Down Expand Up @@ -78,11 +78,13 @@ void* realloc(void* ptr, size_t new_size) {
}

void free(void *ptr) {
// use enforce_init
unsigned arena = init();
//printf("free ptr: %p\n", ptr);
bool b = StarMalloc_free(ptr);
assert (b);
//printf(" result: %b\n");
//if (! b) {
// printf("free ptr: %p\n", ptr);
// assert (b);
//}
return;
}

Expand Down

0 comments on commit 8661f9f

Please sign in to comment.