Hello colleagues, good morning.
In the development of my little audio game, I noticed a small detail that I didn't know how to answer.
My executable combining sdl and csfml audio 2, is 51 KB, (52224 bits), and as I add more code and function calls and all that, when I check how the size has changed, it always stays the same.
It is true that I have not yet added so much information, but how can it be that it always weighs the same?
thank you,
Greetings.
Small size of executable?
-
- Posts: 25
- Joined: Mar 21, 2021 18:22
Re: Small size of executable?
52224 bytes is 51*1024 bytes. The OS (Windows, I guess) creates executables as multiples of 1024 bytes. When your code needs 50*1024+1=51201 bytes, the OS reserves 52224 bytes. You can add 1023 more bytes of code without increasing your executable size.
Re: Small size of executable?
To complete jj2007's post
Look at file properties :
File size and size on disk. The second is equal or greater than the first.
Look at file properties :
File size and size on disk. The second is equal or greater than the first.
-
- Posts: 25
- Joined: Mar 21, 2021 18:22
Re: Small size of executable?
Thank you for your answers.
since you mention it, finally my executable increased in size, by 0.5 MB.
since you mention it, finally my executable increased in size, by 0.5 MB.
Re: Small size of executable?
You mean 0.5kB, i.e. 512 bytes.maurosebastian91 wrote:since you mention it, finally my executable increased in size, by 0.5 MB.
That was wrong, it's actually multiples of 512 bytes - sorry.jj2007 wrote:The OS (Windows, I guess) creates executables as multiples of 1024 bytes
-
- Posts: 3515
- Joined: Jan 02, 2017 0:34
- Location: UK
- Contact:
Re: Small size of executable?
I am being pedantic - 0.5KiB. 
