BinaryByter
However char will take one byte
BinaryByter
olli
UNLESS it is padded
padding does not change the type of the char
BinaryByter
compilers do padding because cpus only support specific read sizes and thus you dont want to have to force t to do a smaller read
olli
it might change the size of a type containing a char member
BinaryByter
something like that
BinaryByter
it only changes the binary
olli
but thats because gcc is bad
can you proof that not using the full register is benefical?
BinaryByter
can you proof that not using the full register is benefical?
mov rax, 0 encodes in 1+8 bytes mov al, 0 encodes in 1+1 byte
BinaryByter
what is then?
olli
show me some scientifical proof.
olli
How this does affect perf or whatever
BinaryByter
BinaryByter
How this does affect perf or whatever
binary sizes are part of perf
olli
Not on my pc so shrug
then show it to me later or another day
BinaryByter
not only because disk rw is slow
olli
binary sizes are part of perf
show me an example where this matters
BinaryByter
then show it to me later or another day
Yea, i'll do it when i am free
BinaryByter
show me an example where this matters
Have you ever endured the pain of downloading a computer game for five hours
olli
Have you ever endured the pain of downloading a computer game for five hours
How big was the game? How much was executable code?
🐰🐾 سمیه
I meant that on a 8 bytes memory, when we declare a char variable, it uses only one byte, and for example if we declare another char, it won't take the address of the next byte adjusting to the previous char, it has to take the beginning address of another row of 8 bytes. Correct?
BinaryByter
but you'll have a byte available to use
🐰🐾 سمیه
BinaryByter
How big was the game? How much was executable code?
11Gig. Sure, there were assets. But my point is that any additional byte is bad
BinaryByter
it would cost nothing to optimize that
olli
Suppose it uses 1 bytes
Compiler specific struct Foo { char a; char b; }; this is likely to not contain padding. struct Foo { char a; int b; }; this is likely to contain 3 Bytes padding (between char and int). Since on this platform int is 4 Bytes and alignment is on 4 Bytes
🐰🐾 سمیه
Aha, How could we understand that how our compiler manage this?
BinaryByter
Why wont the first example contain padding?
BinaryByter
ccs?
compilers
olli
Why wont the first example contain padding?
again - it depends, but why should it?
BinaryByter
I misunderstood
BinaryByter
it might have padding if theres another var after it though
BinaryByter
(char char) (int )
BinaryByter
would pad
olli
(char char) (int )
that's why there is the 2nd example
olli
would pad
no guarantee though
BinaryByter
that's why there is the 2nd example
But it might be important to show that padding can occur on a non struct level
olli
But it might be important to show that padding can occur on a non struct level
well basically padding can occur everywhere except the beginning of the structure
BinaryByter
another way to put it 😂
🐰🐾 سمیه
A cell on memery contains how many of bytes?
🐰🐾 سمیه
Or bits
BinaryByter
🐰🐾 سمیه
I want to know it to understand what is called a cell 😶
BinaryByter
i never heard the term cell when talking about memory
🐰🐾 سمیه
Just encountered it in the book
BinaryByter
do you mean bytes?
🐰🐾 سمیه
No specifically cell
BinaryByter
Then i have no idea
BinaryByter
give us more context please
🐰🐾 سمیه
Couldn't find it right now, next time I'll send it
Ибраги́м
No specifically cell
stores one bit of binary info
Ибраги́м
It's more of electronics
Ибраги́м
But it's still CS too, Digital Electronics. CS100
🐰🐾 سمیه
👌
Ибраги́м
It's the smallest part that can be manipulate in a single op, u know to 0 or 1
🐰🐾 سمیه
what's wrong with printf? it doesn't recognize it?
🐰🐾 سمیه
oh true. thanx
Riccardo
should be lower case p
It's actually written in the error message xD
🐰🐾 سمیه
🐰🐾 سمیه
for the above program, I got these adresses. aren't they weird? I think an adress should be an integer number.
Riccardo
It's an iteger
Riccardo
It's just written in hexadecimal
🐰🐾 سمیه
a hexidecimal
Riccardo
Usually memory addresses are written using the base16
🐰🐾 سمیه
so adress numbers are so long, true? I though they are like 2048 or 2456
Riccardo
64/32bit
Riccardo
Depends on your hardware