[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] How to mark/copy objects in C++
From: |
Joris van der Hoeven |
Subject: |
Re: [Texmacs-dev] How to mark/copy objects in C++ |
Date: |
Tue, 25 May 2004 10:10:55 +0200 (CEST) |
On 24 May 2004, Gabriel Dos Reis wrote:
> 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?
>
> One more tip. If you have a polymophic type T, and a pointer "p" of
> type *T -- that may actually points to a complete object of type U
> derived from T, then
>
> dynamic_cast<void*>(p)
>
> gives you a pointer to the start of the storage of the complete
> object. Therefore, you would be able to mark the complete object and
> you would need to implement the specific bits of marking/copying only
> for the "leaves classes" or "sealed classes", i.e. those from which
> you no longer derive from. That gives you something very general.
OK. But that does not yet answer my main question: how to automatically
and reliably traverse all pointers of data structures. It is a pity that
C++ does not provide any support for this (in a similar way as operators
new and delete, one might have an operator mark with a default
implementation; that would hugely easy writing garbarge collectors).
- Re: [Texmacs-dev] More Scheme benchmarks, (continued)
- [Texmacs-dev] Bigloo?, Joris van der Hoeven, 2004/05/23
- Re: [Texmacs-dev] Bigloo?, Joris van der Hoeven, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, Gabriel Dos Reis, 2004/05/24
- [Texmacs-dev] How to mark/copy objects in C++, Joris van der Hoeven, 2004/05/24
- Re: [Texmacs-dev] How to mark/copy objects in C++, Gabriel Dos Reis, 2004/05/24
- Re: [Texmacs-dev] How to mark/copy objects in C++,
Joris van der Hoeven <=
- Re: [Texmacs-dev] How to mark/copy objects in C++, Gabriel Dos Reis, 2004/05/24
- Re: [Texmacs-dev] How to mark/copy objects in C++, Joris van der Hoeven, 2004/05/25
- Re: [Texmacs-dev] How to mark/copy objects in C++, David Allouche, 2004/05/25
- Re: [Texmacs-dev] How to mark/copy objects in C++, Joris van der Hoeven, 2004/05/26
- Re: [Texmacs-dev] Bigloo?, David MENTRE, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, Joris van der Hoeven, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, Gabriel Dos Reis, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, David MENTRE, 2004/05/24
- Re: [Texmacs-dev] Bigloo?, Joris van der Hoeven, 2004/05/25