In X64, subtracting one pointer from another results in a 64-bit value. Assigning or casting this result to a 32-bit integer can result in loss of data. You should make sure that such results are stored and treated as 64-bit integers in 64-bit builds.