Tweaked error message

This commit is contained in:
2024-09-30 15:29:29 +10:00
parent 8d6bdb88b4
commit 7b8ff8f873
2 changed files with 3 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ void* Toy_partBucket(Toy_Bucket** bucketHandle, size_t space) {
//if you try to allocate too much space //if you try to allocate too much space
if ((*bucketHandle)->capacity < 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); exit(1);
} }

View File

@@ -36,8 +36,8 @@ TOY_API void* Toy_reallocate(void* pointer, size_t oldSize, size_t newSize);
typedef struct Toy_Bucket { typedef struct Toy_Bucket {
struct Toy_Bucket* next; struct Toy_Bucket* next;
void* contents; void* contents;
int capacity; size_t capacity;
int count; size_t count;
} Toy_Bucket; } Toy_Bucket;
TOY_API void Toy_initBucket(Toy_Bucket** bucketHandle, size_t capacity); TOY_API void Toy_initBucket(Toy_Bucket** bucketHandle, size_t capacity);