K
kid joe
Hi all,
If I have a formula with lots of typecasts am I right in thinking that
these are usually not expensive operations?
For a simple example, if i is an int and I cast it to unsigned int in an
expression, AIUI the compiler doesnt need to actually convert i but it
will simply substitute assembly instructions relevant to unsinged instead
of singed (i.e. mul instead of imul, ja instead of jg etc)
What about structs, if a struct S2 is a struct S1 with some extra fields
and I downcast a struct S2 to a struct S1 will this also be a "free"
operation?
Cheers,
Joe
--
...................... o _______________ _,
` Good Evening! , /\_ _| | .-'_|
`................, _\__`[_______________| _| (_|
] [ \, ][ ][ (_|
If I have a formula with lots of typecasts am I right in thinking that
these are usually not expensive operations?
For a simple example, if i is an int and I cast it to unsigned int in an
expression, AIUI the compiler doesnt need to actually convert i but it
will simply substitute assembly instructions relevant to unsinged instead
of singed (i.e. mul instead of imul, ja instead of jg etc)
What about structs, if a struct S2 is a struct S1 with some extra fields
and I downcast a struct S2 to a struct S1 will this also be a "free"
operation?
Cheers,
Joe
--
...................... o _______________ _,
` Good Evening! , /\_ _| | .-'_|
`................, _\__`[_______________| _| (_|
] [ \, ][ ][ (_|