PtrInt, SizeInt, NativeInt lazarus / 62-General ---------------------------------------------------------------------- Zoran · 2016-07-07 11:22 As I understand, PtrInt and SizeInt are signed integer types which have the size of pointer (size of memory address) of target architecture, so on 32-bit system, they are same as LongInt, and on 64-bit they are same as Int64. They are always same, aren't they? My question is - is there a reason why we have two types? Aren't they intended for same purpose? I know there is also NativeInt, which is added because Delphi has this type for same purpose, since they introduced 64-bit support, which happened several years later than FPC. So, I understand why NativeInt is added to FPC, but I would like to know if there is a reason why we have both SizeInt and PtrInt? ---------------------------------------------------------------------- Jonas Maebe · 2016-07-07 11:34 sizeint corresponds to the size of the "offset" part of pointers, while ptrint to the size of an entire pointer. On most platforms these are the same because they use a linear address space, but e.g. on 16 bit MSDOS with a memory model that supports far data, sizeint is 16 bit while ptrint is 32 bit (16 bit segment + 16 bit offset). ---------------------------------------------------------------------- marcov · 2016-07-07 12:01 A different wording of of the sizeint definition might be: sizeint is an integer that can hold the maximum (positive) difference between two pointers within the same allocation. ---------------------------------------------------------------------- Zoran · 2016-07-07 12:28 Thank you, Jonas and Marco.