01b8150625
remove the free function entirely. all allocators are now expected to implement reset instead. I reallized I never ever want to free an individual allocation ever again. The forever_allocator is a special case wherEreset is a no-op. The arena allocator was deleted. It will be replaced soon.
13 lines
467 B
C
13 lines
467 B
C
#include <criterion/criterion.h>
|
|
#include "cig.h"
|
|
|
|
// TODO rename std to forever allocator
|
|
Test(std_allocator, test) {
|
|
allocator_t this = forever_allocator();
|
|
void *ptr = allocator_alloc(this, 10);
|
|
cr_assert(ptr != ((void *)0), "non null from malloc");
|
|
void *new_ptr = allocator_resize(this, ptr, 1024*1024*500);
|
|
cr_assert(new_ptr != ((void *)0), "non null from realloc");
|
|
cr_assert(new_ptr != ptr, "realloc is not the same ptr as malloc");
|
|
}
|