mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 07:49:32 +01:00
* 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:
parent
700aacf6a3
commit
0b3094fdde
@ -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);
|
||||
|
||||
@ -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 }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user