comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Type_Invariant and Finalize
Date: Thu, 17 Jul 2014 21:49:34 +0100
Date: 2014-07-17T21:49:34+01:00	[thread overview]
Message-ID: <ly7g3byald.fsf@pushface.org> (raw)
In-Reply-To: slrnlsg4lu.i0l.lithiumcat@nat.rebma.instinctive.eu

Natasha Kerensikova <lithiumcat@instinctive.eu> writes:

> The latest example is a sorted array of non-null
> paccess-to-indefinite-type values, where the "sortedness" is a natural
> type inveriant, but in Finalize I release the memory using an instance
> of Unchecked_Deallocation.

I don't think these can be null-excluding access types, because you
can't instantiate Unchecked_Deallocation for such a type?

> Or should I prepare for it, e.g. with an explicit boolean record
> component that is False for the most of the lifetime of the object,
> until the first call to Finalize?

This approach is normal, if finalization isn't naturally idempotent.
Sometimes one can use an already-present access value which, if null,
means the object has already been finalized.


  reply	other threads:[~2014-07-17 20:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-17 18:15 Type_Invariant and Finalize Natasha Kerensikova
2014-07-17 20:49 ` Simon Wright [this message]
2014-07-18  6:56   ` Natasha Kerensikova
2014-07-18 21:48     ` Robert A Duff
2014-07-17 21:30 ` Type_Invariant and instance creation (was: Type_Invariant and Finalize) Simon Wright
2014-07-21 23:29   ` Randy Brukardt
2014-07-22  1:13     ` Type_Invariant and instance creation Shark8
replies disabled

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