From 7b8ff8f873553369db796faf77044017b5f84f91 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 30 Sep 2024 15:29:29 +1000 Subject: [PATCH] Tweaked error message --- source/toy_memory.c | 2 +- source/toy_memory.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/toy_memory.c b/source/toy_memory.c index de84439..2bcfe5a 100644 --- a/source/toy_memory.c +++ b/source/toy_memory.c @@ -50,7 +50,7 @@ void* Toy_partBucket(Toy_Bucket** bucketHandle, size_t space) { //if you try to allocate too much space if ((*bucketHandle)->capacity < space) { - fprintf(stderr, TOY_CC_ERROR "[internal] ERROR: Failed to partition bucket memory, not enough capacity\n" TOY_CC_RESET); + fprintf(stderr, TOY_CC_ERROR "[internal] ERROR: Failed to partition bucket memory, not enough capacity: needed %d, only %d available\n" TOY_CC_RESET, (int)space, (int)((*bucketHandle)->capacity)); exit(1); } diff --git a/source/toy_memory.h b/source/toy_memory.h index 95d0b9f..4ca56c6 100644 --- a/source/toy_memory.h +++ b/source/toy_memory.h @@ -36,8 +36,8 @@ TOY_API void* Toy_reallocate(void* pointer, size_t oldSize, size_t newSize); typedef struct Toy_Bucket { struct Toy_Bucket* next; void* contents; - int capacity; - int count; + size_t capacity; + size_t count; } Toy_Bucket; TOY_API void Toy_initBucket(Toy_Bucket** bucketHandle, size_t capacity);