Shouldn't this line also use (size)/4 like line 18, since it's also the size in bytes rather than words?
Also, on the same note, shouldn't this be doing ceiling integer division rather that floor integer division, or are we guaranteed to always get sizes multiples of 4?
Yes, the bounds check should also use (size)/4. The allocations are all supposed to be 4 byte aligned (since they have u32's in them), but I added some manual padding to make sure.
https://github.com/digama0/mm0/blob/6391620f1e0c4878586b95e9badc127bd63258eb/mm0-c/parser.c#L15
Shouldn't this line also use
(size)/4
like line 18, since it's also the size in bytes rather than words?Also, on the same note, shouldn't this be doing ceiling integer division rather that floor integer division, or are we guaranteed to always get sizes multiples of 4?