Autor Beitrag
cbs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 207
Erhaltene Danke: 1



BeitragVerfasst: Sa 11.09.04 21:21 
Hallo Ihrs

Wie kann ich die größe eines objects ermitteln? SizeOf liefert mir immer nur 4 bytes was wohl der pointer selbst ist.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
TMyRecord = packed record
  int: Integer;
  byt: Byte;
end;


liefert mir SizeOf korrekterweise 5 byte

ausblenden Delphi-Quelltext
1:
2:
3:
4:
TMyObject = class(TObject)
  int: Integer;
  byt: Byte;  
end;


liefert mir SizeOf die besagten 4 byte des Pointers

ist ja auch logisch.. nur .. gibs eine funtion wie ich den speicherverbrauch des objects ermitteln kann?

danke schonmal

mfg cbs
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 12.09.04 11:04 
TObject besitzt eine Methode InstanceSize.. die OH verrät dazu mehr..

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
cbs Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 207
Erhaltene Danke: 1



BeitragVerfasst: So 12.09.04 11:45 
ah jo :D

danke dir!