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

Strong pointers as temporaries work!

No compiler bug after all.  Just a bug in my own code that took me
till now to track down because I was looking for a compiler bug.
Moral of the story: Remember that if you don't define a X::X(X& other)
constructor for a type X, the compiler will do it for you.  (Similarly
for X::operator= (X& other), but only the first one screwed me up this

This means the non-pre-emptive world is safe for garbage collection.
(so is the pre-emptive world if we go with disjoint heaps).  In the
generated code, the baton is always passed to the new strong pointer
before the old one is destructed, which may seem to perhaps make the
pre-emptive-shared-heap world safe for garbage collection; but I
wouldn't bet on it.  Besides, I like the disjoint heap idea better

Nice try Peter, but you haven't broken it yet.

Soon to come: checking out Dean's cast idea.