[Openroad-users] Question about the value and use of .InstanceReferences

Peter van Bennekom Peter.vanBennekom at infor.com
Thu Nov 15 03:51:07 EST 2007


Folks,

 

I have noticed that this attribute reflects the number of instances
pointing to this object at runtime - not only does it hold the number of
references in the code but it also reflects when OpenROAD points to it.
Example:

 

PROCEDURE ir_test() =

Declare

          ir_object = ir_class;

EndDeclare

Begin

          Curprocedure.trace( text = 'proc before call: ' + varchar(
ir_object.InstanceReferences ) );

          Ir_object.showIR();

          Curprocedure.trace( text = 'proc after call: ' + varchar(
ir_object.InstanceReferences ) );

End;

 

Ir_class is userclass with two methods:

METHOD showIR() =

Begin

          Curmethod.trace( text = 'showIR: ' + varchar(
curObject.InstanceReferences ) );

End;

 

METHOD showMore() =

Begin

          Curmethod.trace( text = 'showMore: ' + varchar(
curObject.InstanceReferences ) );

End;

 

Output is as follows:

proc before call: 1

showIR: 2

showMore: 3

proc after call: 1

 

One can argue about the value of this kind of increment and decrement.
If one would like to implement a concept of freeing memory when object
is not needed anymore (circular references i.e. but also NULLing pointer
from self - we have found that sometimes when you do not null pointers
when not needed anymore memory is still claimed) based on the
instanceReferences attribute one would find out this is impossible.  One
would like to see how many references the code has (1 in this little
example) so implementing above mentioned concept can be done.

 

My questions to the group are: are you using this attribute, if so: how
are you using it and do you have to jump through hoops to get what you
want?  If you are consciously not using it what kept you from using it?

 

Thanks,

Peter

Peter van Bennekom | Sr. Principal Architect | Infor | office:
610-407-8113 | fax: 610-407-8027 | mailto:peter.vanbennekom at infor.com

  <http://www.infor.com/> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20071114/cbdfa788/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 2926 bytes
Desc: image001.gif
Url : http://www.peerlessit.com/pipermail/openroad-users/attachments/20071114/cbdfa788/attachment.gif 


More information about the Openroad-users mailing list