T
taozhiyu
Unregistered / Unconfirmed
GUEST, unregistred user!
type
PPointer = ^Pointer;
class function TObject.ClassInfo: Pointer;
begin
Result := PPointer(Integer(Self) + vmtTypeInfo)^;
end;
class function TObject.ClassParent: TClass;
{$IFDEF PUREPASCAL}
begin
Pointer(Result) := PPointer(Integer(Self) + vmtParent)^;
if Result <> nil then
Pointer(Result) := PPointer(Result)^;
end;
{$ELSE}
asm
MOV EAX,[EAX].vmtParent
TEST EAX,EAX
JE @@exit
MOV EAX,[EAX]
@@exit:
end;
{$ENDIF}
function TObject.ClassType: TClass;
begin
Pointer(Result) := PPointer(Self)^;
end;
以上给出了几个定义,我不明白类似于PPointer()^和Pointer()有什么区别?有区别?没区别?
PPointer = ^Pointer;
class function TObject.ClassInfo: Pointer;
begin
Result := PPointer(Integer(Self) + vmtTypeInfo)^;
end;
class function TObject.ClassParent: TClass;
{$IFDEF PUREPASCAL}
begin
Pointer(Result) := PPointer(Integer(Self) + vmtParent)^;
if Result <> nil then
Pointer(Result) := PPointer(Result)^;
end;
{$ELSE}
asm
MOV EAX,[EAX].vmtParent
TEST EAX,EAX
JE @@exit
MOV EAX,[EAX]
@@exit:
end;
{$ENDIF}
function TObject.ClassType: TClass;
begin
Pointer(Result) := PPointer(Self)^;
end;
以上给出了几个定义,我不明白类似于PPointer()^和Pointer()有什么区别?有区别?没区别?