Skip to Content.
Sympa Menu

texmacs-users - Reference counting in TeXmacs

Subject: mailing-list for TeXmacs Users

List archive

Reference counting in TeXmacs


Chronological Thread 
  • From: Salman Khilji <address@hidden>
  • To: address@hidden
  • Subject: Reference counting in TeXmacs
  • Date: Tue, 10 Jun 2003 18:50:22 -0700
  • Organization: NA

Following up my previous post, I am looking at the reference counting
mechanism. I suppose I am neglecting something because I fail to undersand
one thing.

Teh reference count is incremented in the constructor and the equality
operator and decremented in the destructor of abstract_struct and
concrete_struct.

When the reference count drops to 0, the object in question is deleted. Why
do we do this? Notice that to decrement the reference, the destructor must
be called. The only way to call the destructor is to call delete on the
object. If you have to delete to object by calling delete on the object,
then why have reference counting in the first place?

I am thinking about that for "my own copy" of TeXmacs, I would get rid of
basic.hh and remove all the reference counting mechnism. Would I break
anything by doing this? basic.hh has lots of preprocessor generated code
some of which I haven't looked at close enough. But I think getting rid of
macros like "CONCRETE_NULL" would definitely make the code easier to
understand.



Salman



Archive powered by MHonArc 2.6.19.

Top of Page