Compare commits

...

1 Commits

Author SHA1 Message Date
Kayne Ruse 3b813da1cf Zero the bucket's memory
Windows doesn't do this automatically.
2026-05-09 13:00:06 +10:00
+3
View File
@@ -4,6 +4,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//buckets of fun
Toy_Bucket* Toy_allocateBucket(unsigned int capacity) {
@@ -16,6 +17,8 @@ Toy_Bucket* Toy_allocateBucket(unsigned int capacity) {
exit(1);
}
memset(bucket, 0, sizeof(Toy_Bucket) + capacity); //zero the memory, to avoid broken header metadata
//initialize the bucket
bucket->next = NULL;
bucket->capacity = capacity;