texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] Mandrake (and thought about typing and ref counting)


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] Mandrake (and thought about typing and ref counting)
Date: Sun, 8 Sep 2002 23:26:10 +0200 (MET DST)

> No I did not try to debug. But the fact is that the code is stable
> without your allocation stuff and not without. I agree that does not
> necessarily mean that the real problem is there.

What I can do is put the allocation stuff in a base class common
to all TeXmacs data structures. It might be that certain programs
have a problem with my global allocater.

I also want to try with Hans Boehme's gc program once,
but this is bound to induce other problems on certain architectures
(especially in combination with shared libraries and with threads
(in the future)).

> My focus is on getting the Qt loop in and I noticed that removing your
> allocation code solves the problem of immediate crash in that case.
> And it appears that by the same removal TeXmacs seems more stable on
> Mandrake cooker rc1 platform. It seems that with g++ the standard
> allocation scheme is fast enough.

Fast enough is not good enough. If we loose 10% that is a lot and
this is independent from using const's or not (which should also yield
an increase in efficiency for the current allocation system).

> If performance is your concern (which must be the case because you get
> out of you way to write allocation code), you can win big by 1/
> passing stuff by const references when we can; 2/ also removing
> reference counting would be good except if there is a strong
> motivation for it (Guile).

If one removes reference counting, then copying becomes very expensive.
This is certainly a bad strategy. I don't like consts either (dirty code),
but I would accept them in the most basic data structures.

> But these are totally different issues. The
> combination of reference counting with pass by value is probably
> disastrous.

Right, disastrous is the word I was searching for :^)

> Related issues that bothers me now I got more understanding of C++ (by
> reading Stroustrup, Meyers and Alexandrescu, and experimenting on my
> own) is the style prevaling in TeXmacs where the nature of objects is
> hidden by typedef:
> 
> typedef foo*  foo_rep 
> 
> As a result it is never immediately clear when pointers are passed
> around.  I understand that for esthetic reasons one does not want to
> sprinkle code declaration with consts and non alphabetic chars but I
> am less and less sure this style is real C++.

Real C++ is what programmers do with C++.

> Sorry for this diversion, but I think we need to think and agree about
> it. I think that david has already talked about that but I don't
> remember exactly what.

Yes, he also wants to change everything, but I am getting tired of
these discussions and there are many other important and urgent issues.
Also, I certainly do not like ugly code and this is what const'ed code is like.
I tend to use few comments in my code, but this is counterbalanced by
a certain notational elegance and coherence. I do not want to change this.

> The problem with C++ is that everything must be compiled with the same
> version of the same compiler. Apparently, if you don't and that you
> code links with libraries, it can nevertheless crash.

It depends on the particular version change, but they certainly
tend to say this for the change from 3.1 and 3.1.1 to 3.2.

> But this does not concern X libraries because they are C libraries.

Are you sure? And similarly for Guile?

So is it sufficient for me to recompile gcc 3.2 and TeXmacs using gcc 3.2
in order to get a working version (modulo the bugs which were mentioned)?
Can it be that the bugs are precisely due to the fact that some libraries
were not recompiled using gcc 3.2?





reply via email to

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