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

Re: Update



On Thu, 3 Feb 2000, Bjarke Hammersholt Roune wrote:

>When I try to compile PFile, my compiler hangs. Yes, that's right,
>hangs. I have to stop it manually, and then the files it was compiling
>will be locked for a minute or so. Veeeeeery annoying.

This can happen (I think) if you have circular references that are not
dynamically allocated, such as:

// forward declaration
class B;

class A {

  // members
  B  aB;
};

class B {

  // members
  A anA;
};

I think this could cause the problem. The compiler just expands the
members recursively, leading into infinite recursion. The compiler eats
memory and CPU. You could change (if this is the problem) one of the
instances to be dynamically allocated, such as:

class B {
  // constructor 
  B () { anA = new A; }

  // members
  A * anA;
};

I've had similar problems, and they also appeared "out of the blue" when
making a total recompilation. If some files didn't need recompilation the
problem didn't always occur.

Hope this is of at least some use...

---------------------+------------------------------------------------------
 Jan 'Chakie' Ekholm |    CS at Åbo Akademi University, Turku, Finland
    Linux Inside     | I'm the blue screen of death, no-one hears you scream