somic wrote:@eesau
I understand your point, but SizeOf(*addr) gives correct size of anything pointed by *addr.
I guess that, somewhere in the memory there should be stored the info.
If you use SizeOf(*addr) it will always be equal to the size of an Integer. Pointers are Integer variables that reference an address. Here is example code to illustrate:
Code: Select all
Define *addr.Quad,*addr2.Byte
Debug SizeOf(*addr) ;displays 4 on x86 32-bit
Debug SizeOf(*addr2) ;displays 4 on x86 32-bit
I don't think the size is stored anywhere in memory. SizeOf() is a compiler function which means that it doesn't use runtime values. That means the values wouldn't be stored in memory during runtime.