* from Thomas Schatzl: changed result type of InstanceSize to PtrInt

* simplified some code
* small methods of tobject are now inlined

git-svn-id: trunk@1170 -
This commit is contained in:
florian 2005-09-24 08:35:43 +00:00
parent 700aacf6a3
commit 0b3094fdde
2 changed files with 7 additions and 7 deletions

View File

@ -116,10 +116,10 @@
self.destroy;
end;
class function TObject.InstanceSize : LongInt;
class function TObject.InstanceSize : SizeInt;
begin
InstanceSize:=plongint(pointer(self)+vmtInstanceSize)^;
InstanceSize:=pSizeInt(pointer(self)+vmtInstanceSize)^;
end;
procedure InitInterfacePointers(objclass: tclass;instance : pointer);
@ -153,7 +153,7 @@
begin
{ the size is saved at offset 0 }
fillchar(instance^,plongint(pointer(self)+vmtInstanceSize)^,0);
fillchar(instance^, InstanceSize, 0);
{ insert VMT pointer into the new created memory area }
{ (in class methods self contains the VMT!) }
ppointer(instance)^:=pointer(self);
@ -175,7 +175,7 @@
p : pointer;
begin
getmem(p,plongint(pointer(self)+vmtInstanceSize)^);
getmem(p, InstanceSize);
if p <> nil then
InitInstance(p);
NewInstance:=TObject(p);

View File

@ -127,12 +127,12 @@
procedure Free;
class function InitInstance(instance : pointer) : tobject;
procedure CleanupInstance;
class function ClassType : tclass;
class function ClassType : tclass;{$ifdef SYSTEMINLINE}inline;{$endif}
class function ClassInfo : pointer;
class function ClassName : shortstring;
class function ClassNameIs(const name : string) : boolean;
class function ClassParent : tclass;
class function InstanceSize : longint;
class function ClassParent : tclass;{$ifdef SYSTEMINLINE}inline;{$endif}
class function InstanceSize : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif}
class function InheritsFrom(aclass : tclass) : boolean;
class function StringMessageTable : pstringmessagetable;
{ message handling routines }