对Object Pascal编译器给类对象分配堆内存细节的一种大胆猜测(下)[2]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 mahongxi 的 blog

  self.x := 2;

  self.y := 3.14;

end;

 

procedure tbase.freeinstance;

begin

  inherited;

  showmessage(format('call %s.freeinstance!!!',[self.classname]));

end;

 

class function tbase.newinstance: tobject;

begin

  showmessage(format('call %s.newinstance',[self.classname]));

  result := inherited newinstance;

end;

 

之后进行简单的声明对象:

var

b : tbase;

begin

本文关键:Object Pascal 分配内存
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top