phoboslab / wipeout-rewrite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query: mem_temp_alloc 8 bytes alignment of size

sujankh opened this issue · comments

Hi, when looking at the the bump allocator i was assuming the following would modify size to be the next multiple of 8 but looks like it is not.

	size = ((size >> 3) + 7) << 3; // allign to 8 bytes

size = ((size >> 3) + 7) << 3; // allign to 8 bytes

Here is what i see when i add some logs

size: 16  --> becomes: 72
size: 4224  --> becomes: 4280

When user request 16 bytes, do we need to reserve 72 bytes in the temp? We could just reserve 16 bytes right?

Good catch, thanks!