[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: KJS crashes
From: Harri Porten <porten () trolltech ! com>
Date: 2001-08-01 11:10:10
[Download RAW message or body]
On Wed, 1 Aug 2001, Dirk Mueller wrote:
> On Die, 31 Jul 2001, Dirk Mueller wrote:
>
> > > This patch should fix the problem.
> > The patch makes obviously sense, please apply (calling a virtual method
> > without a full constructor run before can't work).
>
> Actually, after having slept a night over it I don't understand anymore why
> it is supposed to work.
Heh. Now *I* don't feel so stupid anymore :) There is no "virtual method"
involved as far as I see it btw.
> I think "new Classname" is an atomic operation ?
> how can there be another allocation before the constructor ran ?
>
> Isn't the actual problem that we allocate another Imp derivative during
> executing an Imp derived constructor ?
That certainly happens in many cases but I don't understand why this
causes a problem. The crash happened in the memory managment but the
allocation is done before the respective ctor is run. And why didn't the
following code in Collector::allocate() already help if there is a
problem with the gc ?
// hack to ensure obj is protected from GC before any constructors are
run
// (prev = marked, next = gcallowed)
static_cast<Imp*>(m)->prev = 0;
static_cast<Imp*>(m)->next = 0;
Harri (happy that a crash is gone but curious to know what is was about)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic