fix constant issue, and make running of test program dependent on successful build

This commit is contained in:
2025-10-09 21:17:29 +02:00
parent 4942d959d5
commit 6e3211ab49
4 changed files with 11 additions and 9 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ void allocator_free_func(allocator_t this, void *ptr, const char *file, int line
#define allocator_free(this, ptr) allocator_free_func(this, ptr, __FILE__, __LINE__)
// std_allocator ///////////////////////////////////////////////////////////////
extern const allocator_t allocator_stdlib;
allocator_t allocator_stdlib();
// buffer_allocator ////////////////////////////////////////////////////////////
typedef struct buffer_allocator {
size_t size, capacity;
@@ -47,7 +47,7 @@ typedef struct buffer_allocator {
#define buffer_allocator_create(CAPACITY) \
((buffer_allocator_t){ \
.size = 0, .capacity = CAPACITY, .data = (uint8_t[CAPACITY]){}})
.size = 0, .capacity = CAPACITY, .data = (uint8_t[CAPACITY]){0}})
allocator_t buffer_allocator_interface(buffer_allocator_t *this);
void *buffer_allocator_alloc(buffer_allocator_t *this, size_t bytes);