From 3345e17e3c522c2a1dec8a3161f74dac7211ece5 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Thu, 28 Feb 2019 08:34:32 +0000 Subject: [PATCH] Fix marker indexing --- containers/named_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/named_array.c b/containers/named_array.c index 7cbd484..3aac6b5 100644 --- a/containers/named_array.c +++ b/containers/named_array.c @@ -61,7 +61,7 @@ void* named_array_alloc(NamedArray* array, unsigned int* new_id) { void* named_array_reserve(NamedArray* array, unsigned int id) { if(!named_array_used(array, id)) { unsigned int j = (id % 8) - 1; - unsigned int i = (id - j) / 8; + unsigned int i = id / 8; assert(!named_array_used(array, id)); array->used_markers[i] |= (unsigned char) 1 << j;