Pack Vehicle and StreamInVehicle more tightly#1091
Conversation
Vehicle from 480 bytes to 464 bytes, StreamInVehicle from 116 bytes to 108 bytes
|
@AmyrAhmady |
|
It's packing the structures so we don't waste memory due to assigned paddings during allocations. |
so saving (at max vehicles) 0.032 megabytes matters now? I got the cache part but memory cmon |
|
It isn't about only those two structure members. All of them are done like and those two weren't following. Also I said "during allocation", maybe I wasn't clear enough. more space to allocate (even small) = less impact on performance But the whole idea of this PR was to fix something that is done everywhere and it was missing for those two members. I we didn't care about it and all the other members had byte paddings then the size difference wouldn't have been that small for you to nitpick it |
I just asked, because usually on the official discord server people would burn you alive if you talked about megabytes of memory in your script yet here 32kb was a concern, sorry~~ |
|
It's fine |

Minor size optimizations
Pack Vehicle and StreamInVehicle more tightly
Size decrease: for Vehicle from 480 bytes to 464 bytes, for StreamInVehicle from 116 bytes to 108 bytes
May be useful for future development, to avoid crossing alignment boundary
No functional changes whatsover