texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] How to mark/copy objects in C++


From: Gabriel Dos Reis
Subject: Re: [Texmacs-dev] How to mark/copy objects in C++
Date: 24 May 2004 21:01:32 +0200

Joris van der Hoeven <address@hidden> writes:

| A question for Gabriel: would there be an easy way to implement
| type-safe marking/copying routines in C++ for all TeXmacs types.
| Of course, we can manually write such routines for each type,
| but there might be a more automatic way. What do you think?

The type-safest way I can see at the moment is to make those routines
part of the types, i.e. virtual functions that must be overriden.  But
from what I understand you do have lots of those types?

Alternatively, you can have your compiler dumps the class hierarchies and
use the ABI to accurately locate objects (not necessary the easiest
way). For example, if your compiler is GCC, then the ABI is documented
here

    http://www.codesourery.com/cxx-abi/

(the document unfortunately refers to Itanium 64, but most of the ABI
is non-specific to that processor).  I do not have an idea about MS
compilers.  But I suppose, that is a harder option than the previous
method.

We're currently developing a tool/framework here at TAMU that
makes that an easier task, but it is not ready yet :-(

I've seen some TeXmacs fragments that say "new T(...)" -- I just wanted
to say that allocation of large chuncks are frequently cheeper than
allocation of lots of small chunks.  Someone would probably have to
audit that for TeXmacs (the primary reason being that in
multi-threaded environment -- if you're windowing, then you get such
beasts -- mutext locks/unlocks are expensive operations).

-- Gaby




reply via email to

[Prev in Thread] Current Thread [Next in Thread]