Update docs and assertions
This commit is contained in:
10
arena.h
10
arena.h
@@ -77,6 +77,10 @@
|
||||
// Warning: this functions may cause fragmentation, consider setting an
|
||||
// appropriate region capacity.
|
||||
//
|
||||
// [Note]
|
||||
//
|
||||
// This library is not Thread-safe.
|
||||
//
|
||||
// [Example]
|
||||
//
|
||||
#if 0
|
||||
@@ -171,7 +175,7 @@ Arena arena_create(size_t region_capacity)
|
||||
void *arena_alloc(Arena *a, size_t size)
|
||||
{
|
||||
if (a == NULL || size == 0) {
|
||||
ARENA_ASSERT(!"Invalid, parameters");
|
||||
ARENA_ASSERT(false && "Invalid, parameters");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -185,7 +189,7 @@ void *arena_alloc(Arena *a, size_t size)
|
||||
NULL, sizeof(*a->head) + alloc_size);
|
||||
|
||||
if (a->head == NULL) {
|
||||
ARENA_ASSERT(!"Reallocation failed");
|
||||
ARENA_ASSERT(false && "Reallocation failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -213,7 +217,7 @@ void *arena_alloc(Arena *a, size_t size)
|
||||
NULL, sizeof(*a->tail) + alloc_size);
|
||||
|
||||
if (a->tail->next == NULL) {
|
||||
ARENA_ASSERT(!"Reallocation failed");
|
||||
ARENA_ASSERT(false && "Reallocation failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user