memalloc icon indicating copy to clipboard operation
memalloc copied to clipboard

Question on Bytes vs Words in Chunk struct

Open SamerKhshiboun opened this issue 1 year ago • 0 comments

https://github.com/tsoding/memalloc/blob/f17f6e826c92d265614ab6d6f6a63dc8731720cf/heap.c#L17

should not this be .size = HEAP_CAP_WORDS ?

All other comparisons of chunk.size in the code are against WORDS, not bytes. Example: const size_t tail_size_words = chunk.size - size_words; Here we are missing between bytes and words..

SamerKhshiboun avatar Sep 16 '24 06:09 SamerKhshiboun