From 3b813da1cf8a8d5838d837fd6784e37dcf91b5c4 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 9 May 2026 12:57:57 +1000 Subject: [PATCH] Zero the bucket's memory Windows doesn't do this automatically. --- source/toy_bucket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/toy_bucket.c b/source/toy_bucket.c index 73aa187..ae42a69 100644 --- a/source/toy_bucket.c +++ b/source/toy_bucket.c @@ -4,6 +4,7 @@ #include #include #include +#include //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;