comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Reference counting and idempotent finalize
Date: Thu, 12 Sep 2013 09:54:00 +0200
Date: 2013-09-12T09:54:00+02:00	[thread overview]
Message-ID: <1adx00b15pjmu.k2vsys1vrxp3.dlg@40tude.net> (raw)
In-Reply-To: slrnl32is7.1lme.lithiumcat@sigil.instinctive.eu

On Thu, 12 Sep 2013 05:05:27 +0000 (UTC), Natasha Kerensikova wrote:

> A negative value of Counter would mean something is seriously wrong with
> the compiler or the memory has been corrupted.

Yes it happens not very frequently. A far more probable issue when the
count has to be checked against 0 is in the Finalize of counted objects. If
you discover that the count is not zero, that is a serious problem. This
happens very often upon exception propagation when there are still
outstanding references and the compiler calls Finalize because something
(some type for example) goes out for the scope. There is a funny rule that
the compiler has to maintain a list of controlled objects and call Finalize
on its own when you least expect it...

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2013-09-12  7:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11 10:45 Reference counting and idempotent finalize Natasha Kerensikova
2013-09-11 11:21 ` AdaMagica
2013-09-11 12:12 ` Dmitry A. Kazakov
2013-09-12  5:34   ` Natasha Kerensikova
2013-09-12  7:33     ` Dmitry A. Kazakov
2013-09-11 12:16 ` Dmitry A. Kazakov
2013-09-12  4:53   ` Natasha Kerensikova
2013-09-11 12:21 ` Jeffrey R. Carter
2013-09-11 20:03   ` Simon Wright
2013-09-12  4:46     ` Natasha Kerensikova
2013-09-12  5:05   ` Natasha Kerensikova
2013-09-12  7:54     ` Dmitry A. Kazakov [this message]
2013-09-12 17:03     ` Jeffrey R. Carter
2013-09-11 13:50 ` Pascal Obry
2013-09-12  4:56   ` Natasha Kerensikova
2013-09-12 14:33     ` Simon Wright
2013-09-12 15:40     ` Pascal Obry
2013-09-12 10:23 ` sbelmont700
2013-09-30  6:25 ` Natasha Kerensikova
2013-09-30 10:02   ` AdaMagica
2013-10-01  6:22     ` Natasha Kerensikova
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox