64-bit insider volume 1 issue 4

6
64-bit Insider Newsletter Volume 1, Issue 4 Page 1/6 64-bit Insider Volume I, Issue 4 Guidelines for Writing Effective Polymorphic Code: Part 2 In Issue 3 of our newsletter, we talked about the pointer truncation errors that might occur when completing a 32- bit to 64-bit code migration. In this issue, we continue our discussion by examining what happens when pointer trun- cation occurs and how you can use polymorphic data types to solve this problem. If you recall the example from Issue 3, we compiled code that resulted in several pointer truncation issues. Before we demonstrate how to fix the code, let’s take a look at how pointer truncation occurs.  Examining How Pointer Truncation Occurs In the example from Issue 3, we had a void pointer called myPointer . The following sections explain what happens when the pointer is typecast to an int type and an INT_PTR type on both 32-bit and 64-bit platforms. Remember that the INT_PTR type is always the same size as a pointer on both 32-bit and 64-bit platforms. On a 32-bit Platform  Typecasting from a pointer to an int type: the poin- ter and int have the same size, so pointer truncation The 64-bit Advantage The computer industry is chang- ing, and 64-bit technology is the next, inevitable step. The 64-bit Insider newsletter will help you adopt this technology by provid- ing tips and tricks for a successful  port. Development and migration of 64- bit technology is not as compli- cated as the 16-bit to 32-bit transi- tion. However, as with any new technology, several areas do re- quire close examination and con- sideration. The goal of the 64-bit  Insider newsletter is to identify potential migration issues and provide viable, effective solutions to these issues. With a plethora of Web sites already focused on 64- bit technology, the intention of this newsletter is not to repeat previously published information. Instead, it will focus on 64-bit issues that are somewhat isolated yet extremely important to under- stand. It will also connect you to reports and findings from 64-bit experts.

Upload: nayeemkhan

Post on 08-Apr-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 64-Bit Insider Volume 1 Issue 4

8/6/2019 64-Bit Insider Volume 1 Issue 4

http://slidepdf.com/reader/full/64-bit-insider-volume-1-issue-4 1/6

Page 2: 64-Bit Insider Volume 1 Issue 4

8/6/2019 64-Bit Insider Volume 1 Issue 4

http://slidepdf.com/reader/full/64-bit-insider-volume-1-issue-4 2/6

Page 3: 64-Bit Insider Volume 1 Issue 4

8/6/2019 64-Bit Insider Volume 1 Issue 4

http://slidepdf.com/reader/full/64-bit-insider-volume-1-issue-4 3/6

Page 4: 64-Bit Insider Volume 1 Issue 4

8/6/2019 64-Bit Insider Volume 1 Issue 4

http://slidepdf.com/reader/full/64-bit-insider-volume-1-issue-4 4/6

Page 5: 64-Bit Insider Volume 1 Issue 4

8/6/2019 64-Bit Insider Volume 1 Issue 4

http://slidepdf.com/reader/full/64-bit-insider-volume-1-issue-4 5/6