The time goes by and the programmers are already using the updated version of C++ language, which is called C++11. AT this point a lot of modernizations, described in the C++11 standard are supported by most of the compilers. Can these modernizations help a programmer to avoid 64-bit errors? You may find the answer by reading the article “C++11 and 64-bit Issues” Continue reading
Development of 64-bit C/C++ applications
Part 27. Estimating the cost of 64-bit migration of C/C++ applications
Starting to plan the port of your project to a 64-bit system, you must be able to estimate the amount of work and material costs. Let us consider those components that make up the total cost of creating a 64-bit software product. Continue reading
Part 26. Peculiarities of creating installers for the 64-bit environment
When developing the 64-bit version of an application, you should also be very attentive to the issue of program distribution – you might encounter some peculiar problems when installing the program on a 64-bit operating system, and if you forget about them, you will get a non-working installation package. First of all you should understand that the program installer itself (the exe-file that launches the installation process) can technically be either a 32-bit application or a 64-bit one. Continue reading
Part 25. Optimization of 64-bit programs
Reducing amounts of memory being consumed
When a program is compiled in the 64-bit mode, it starts consuming more memory than its 32-bit version. This increase often stays unnoticed, but sometimes memory consumption may grow twice. The growth of memory consumption is determined by the following factors: Continue reading
Part 24. Phantom errors
We have finished studying the patterns of 64-bit errors and the last thing we will speak about, concerning these errors, is in what ways they may occur in programs.
The point is that it is not so easy to show you by an example, as in the following code sample, that the 64-bit code will cause an error when “N” takes large values: Continue reading
Part 23. Pattern 15. Growth of structures’ sizes
A growth of structures’ sizes is not an error by itself but it may lead to consumption of an unreasonably large memory amount and therefore to performance penalty. Let us consider this pattern not as an error but as a cause of 64-bit code inefficiency. Continue reading
Part 22. Pattern 14. Overloaded functions
When porting a 32-bit program to a 64-bit platform, you may encounter changes in its logic related to the use of overloaded functions. If a function is overlapped for 32-bit and 64-bit values, the access to it with an argument of a memsize-type will be translated into different calls on different systems. This technique may be useful as, for example, in this code: Continue reading
Part 21. Pattern 13. Data alignment
Processors work more efficiently when the data are aligned properly and some processors cannot work with non-aligned data at all. When you try to work with non-aligned data on IA-64 (Itanium) processors, it will lead to generating an exception, as shown in the following example: Continue reading
Part 20. Pattern 12. Exceptions
Generation and processing of exceptions using integer types is a bad practice of C++ programming. You should use more informative types for these purposes, for example types derived from the class std::exception. But sometimes you have to deal with a low-quality code like this: Continue reading
Part 19. Pattern 11. Serialization and data interchange
Succession to existing data interchange protocols is an important component of the process of porting a program solution to a new platform. You need to provide the capability of reading the existing projects’ formats, data interchange between 32-bit and 64-bit processes, etc. Continue reading