The .NET Framework allocates less memory for a Int32 than for a Int64 in 64 bit systems?
The .NET Framework allocates less memory for a Int32 than for a Int64 in
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Int32 and Int64 should consume the same space on all platforms (meaning an Int32 consumes the same amount as another Int32 on both x86 and x64). On all platforms, Int32 should consume different amount than Int64.
However, both Int32 and Int64 are poor examples, since they are structs. Objects consume significantly different space on x64 vs. x86, because they are basically pointers and pointers on x64 are twice as wide as on x86. This applies to function addresses, jump addresses, vtables, call instructions and so on and so forth. An x64 compiled application, and a IL application JIT code for x64 will be significantly larger than its x86 counterpart. It used to be also that the x86 code generation was more mature and optimized more aggressively simply because the compilers were more mature (this applied to JIT code generation as well) but the compiler caught up and now days the x64 optimizations are on-par, if not better than x86 ones.