Hot answers tagged

73

Benefits of 32-bit software in 64-bit environments Lower memory footprint, especially in pointer-heavy applications, 64-bit vs 32-bit can easily double the memory requirements. Object files are smaller as well. Compatibility with 32-bit environments. Memory leaks are hard capped to 2 GB, 3 GB, or 4 GB and won't swamp the entire system. ...


60

The general problem is that it’s very easy to encode undocumented assumptions in a program, and very hard to find places where those assumptions were made. High-level languages tend to insulate us from these concerns somewhat, but in lower-level languages used for implementing platforms and services, it’s easy to do things that are not necessarily portable ...


29

The 64-bit extension for 80x86 processors (nowadays called just x86) was invented by AMD. Back then Intel was betting on the Itanium line for servers and even went on record saying that "64 bits won't be needed on the desktop anytime soon". AMD, on the other hand, was producing the successful Athlon line, which for a short while was much faster and ...


26

Most software will work the same when compiled for both the 32 and 64 bit Intel/AMD architectures. However, some software will not. Aside from laziness, or reaching a larger audience, there are some specific reasons why recompiling as 64 bit will not work. Software may use unsafe pointer operations. Perhaps a program puts a pointer into an int, which is ...


17

I would like to have a [...] way of creating unique error numbers, across projects and across developers. IMHO that is the bad idea. You should avoid the need for having a global unique error number across project boundaries. That is a global requirement you cannot fulfill as soon as you need to add third-party components, and at the long run, it will ...


16

The number is treated as an unsigned integer in this case which means all bits set will not produce -1 (if if where signed then yes, it would be correct). So all 16 bits set will give you 65535. Interesting enough though, signed state isn't a factor when doing logic bit-operations. Bits are themselves not signed as they are the lowest component in a ...


14

I really don't think its a huge complexity for the end user to have to select either a 32bit or 64bit option when downloading. But if you can use the user-agent strings to make a suggestion all the better. Another option is to have your installer detect and install the correct binary for the user's platform. That makes for a larger download, but then the ...


14

It is trivial. 65535 in binary is all ones, so ANDing it with any X less than 65535 will give you X.


10

This works brilliantly on 64 bit machines, but the resulting integer is too large for 32 bit computers. Actually, 32 bit computers can handle 64 bit numbers just fine. OK, so 64 bit arithmetic might take a few extra clock cycles on a 32 bit machine, but this is unlikely to be significant. (Or even relevant ... in your use-case.) For instance, the ...


9

IPv4 is a very good example where a limited spec size caused a very expensive problem down the line. 4.3 billion addresses just aren't enough anymore. Now ISPs around the world are desparately rolling out IPv6 with a 128-bit address space which translates into an address for every atom in your body or something like that.


7

Answering the second part of your question. You've tagged it as 32-bit so, 65535 in 32 bits is 00000000000000001111111111111111, signed or unsigned it is not -1.


7

The difference between 32 bit software and 64 bit software is the size of the pointers, and maybe the size of the integer registers. That's it. That means all pointers in your program are twice the size. And (at least on an ILP32/LP64 architecture) your longs are twice the size as well. This typically works out to about a 30% increase in object code size. ...


7

If the software needs to interface directly with legacy systems, drivers or libraries, then you may need to supply a 32-bit version, since AFAIK the OS generally (definitely Windows and Linux AFAIK) doesn't allow mixing of 64-bit and 32-bit code within a process. For example, if your software needs to access specialty hardware, it's not uncommon for ...


6

Well, first find out whether using a 64-Bit version would ever be beneficial: Could the dataset processed ever be big enough to need a 64 Bit address-space to work? Is the 64 Bit version ever more efficient or faster? Are there any interoperability-scenarios sensitive to your programs bitness, changing the interface to make it insensitive to bitness isn't ...


4

Nowadays, people and sites tend to handle this by themselves and let the user choose if they want to. So using User-agent string is a good way to go. IMO that also make your application and site looks more professional (people like stuff more if it is capable of making related adjustments by themselves). Placing a choose version link/choice is good since ...


3

Have a 32bit installer which doesn't contain the executable. Have it detect the target platform it runs on and then downloads the correct binary from your server.


3

Why not use a string data type for the error code instead of a number? This will allow large code to be stored without any issues as to integer size. Even though the error code does look like a number, unless the design is calling for arithmetic with it then it is not a number, then it really should be a string data type. I'm also a little concerned ...


3

You have choices: everyone uses the same architecture as you're providing to users. If you ship 64 bit, then develop on 64bit. Everyone uses whatever dev architecture they like, and you ensure quality through a good integration environment, or multiple if you ship different versions. There are problems, but these are quite temporary - in that you might ...


3

This is a very bad idea. You want "Easy and memorable". You've already discovered that your solution isn't easy. You're considering backing yourself into a 64-bit corner to solve this problem. What happens when Mary Smith and Mike Simpson join the team? How can you guarantee uniqueness of the numeric part? Whenever you rely on programmer memory, you place ...


3

Yes, there is a Flags attribute that lets you use enums as flags for an int, and the type has methods to help identify if a flag is set and the such.


2

If you must really go that way (sometimes it's a requirement imposed by the "up-aboves"). you could create long explicit String codes ie : ERROR__PROJECT_COULD_NOT_CREATE_THAT_UBER_IMPORTANT_RESOURCE and through a deterministic hashing function turn it into a 32 bit integer. Ideally to be global you should probably have some sort of centralized ...


2

The Handbook of Floating-point Arithmetic, while rather expensive, is about as comprehensive a reference as you can get on the subject. It's designed with applicative uses in mind though it may be hard to parse the formal sections of math contained there-in. However, it will give a solution set for division in both hardware and software if you can parse the ...


1

If your software is a DLL, you MUST provide both 32-bit and 64-bit versions. You have no idea whether the customer will be using 32-bit or 64-bit software to talk to the DLL, and the DLL has to use the same bit-length as the application. This is non-negotiable. If your software is a standalone executable, it's less clear. If you don't need your software ...


1

Expanding on @Telastyn's answer, you can declare your flags as an enum with the Flags attribute instead of using an array of booleans: [Flags] public enum Options : uint { Empty = 0, FancyClouds = 1, EnhancedGrassTextures = 2, HiDefNoses = 4, NoPantsMode = 8, // etc. values are increasing powers of 2 up to 2^31 } You can fiddle ...


1

Given the division: AAABBBCCC / X it can be rewritten to the form: (AAA * 10^6 / X) + (BBB * 10^3 / X) + (CCC / X). These algebraic formulae, plus or minus some division or multiplication by powers of 10, will get the answer.


1

There's far less probability of issues if you all use the same toolchain. There may not ever be a problem, but can you soak the time spent investigating why "it works on my machine" for our 64bit friends, and not with your 32bit ones if there is? It's usually the best option to go with lowest common denominator. Behaviour does sometime differ from platform ...


1

The year 2000 problem was similar, except that people used decimal numbers instead of binary, and encoded just two last digits. This can be a useful example if explaining to someone who has little experience with binary. FAT12/FAT16/FAT32 were adapted to cover for bigger and bigger storage. TeX has some interesting properties when representing dimensions ...



Only top voted, non community-wiki answers of a minimum length are eligible