CVS difference for ais/ai-00280.txt
--- ais/ai-00280.txt 2004/11/04 22:37:26 1.7
+++ ais/ai-00280.txt 2004/11/14 06:37:05 1.8
@@ -1,5 +1,8 @@
-!standard 9.04 (20) 04-07-04 AI95-00280/04
+!standard 9.04 (20) 04-11-04 AI95-00280/05
!standard 4.08 (11)
+!standard 7.06.01 (11)
+!standard 11.05 (20)
+!standard 11.05 (21)
!class binding interpretation 01-12-21
!status Amendment 200Y 04-07-02
!status ARG Approved 8-0-0 04-06-17
@@ -9,16 +12,17 @@
!priority High
!difficulty Medium
!subject Allocation, deallocation, and use of objects after finalization
+
!summary
Calling an entry or subprogram of a protected object after the object is
finalized is a bounded error, either raising Program_Error or working normally.
-Evaluating an allocator for an access type whose designated type has a task
-part after the master has completed waiting for dependent tasks raises
+Evaluating an allocator for an access type whose designated type has a
+task part after the master has completed waiting for dependent tasks raises
Program_Error.
-Evaluating an allocator after the finalization of the collection for an
+When evaluating an allocator after the finalization of the collection for an
access type has begun:
If the designated type has a controlled or protected part, Program_Error
is raised.
@@ -118,15 +122,15 @@
procedure Free is new Ada.Unchecked_Deallocation (T2, T2_Ref);
end P;
-Assuming that T2_Ref's finalization is non-null (i.e. that the set of allocated
-objects to be iterated over is non-empty), P.T2's Finalize procedure will be
-invoked during P.T2_Ref's collection finalization.
+Assuming that P.T2_Ref's finalization is non-null (i.e. that the set of
+allocated objects to be iterated over is non-empty), P.T2's Finalize procedure
+will be invoked during P.T2_Ref's collection finalization.
P.T1's finalize procedure will be invoked after P.T2_Ref's collection
finalization is complete (because P.X1 is declared before P.T2_Ref).
-Either of these two procedures might contain allocators of type T2_Ref or
-Tsk_Ref, or calls to P.Free.
+Either of these two procedures might contain allocators of type P.T2_Ref or
+P.Tsk_Ref, or calls to P.Free.
As the RM is currently defined, there could exist objects which never would be
@@ -160,7 +164,7 @@
check is a distributed overhead on allocations, and provides no benefit for
types with a trivial finalization. Thus, we require this check only for access
objects that have a non-trivial finalization. For other objects, this case is
-declared to be a bounded error, allowing implementation to make the check if
+declared to be a bounded error, allowing implementations to make the check if
they wish, or ignore the problem (as there is no ill effect). This minimizes
the overhead.
@@ -184,6 +188,10 @@
If the created object contains any tasks, they are activated (see 9.2).
Finally, an access value that designates the created object is returned.
@dby
+If the object created by the @fa<allocator> has a controlled or protected part,
+and the finalization of the collection of the type of the @fa<allocator> (see
+7.6.1) has started, Program_Error is raised.
+
If the created object contains any tasks, and the master of the type
of the @fa<allocator> has finished waiting for dependent tasks (see 9.3),
Program_Error is raised.
@@ -191,10 +199,6 @@
If the created object contains any tasks, they are activated (see 9.2).
Finally, an access value that designates the created object is returned.
-If the object created by the @fa<allocator> has a controlled or protected part,
-and the finalization of the collection of the type of the @fa<allocator> (see
-7.6.1) has started, Program_Error is raised.
-
@s8<@i<Bounded (Run-Time) Errors>>
It is a bounded error if the finalization of the collection of the type
@@ -235,6 +239,28 @@
is raised. Otherwise, the call proceeds normally, which may leave a task queued
forever.
+!corrigendum 11.05(20)
+
+@dinsb
+@xhang<@xterm<Elaboration_Check>
+When a subprogram or protected entry is called, a task activation is
+accomplished, or a generic instantiation is elaborated, check that the body of
+the corresponding unit has already been elaborated.>
+@dinss
+@xhang<@xterm<Accessibility_Check>
+Check the accessibility level of an entity or view.>
+@xhang<@xterm<Allocation_Check>
+For an @fa<allocator>, check that the master of any tasks has not yet finished
+waiting for dependents, and that the finalization of the collection has not
+started.>
+
+!corrigendum 11.05(21)
+!comment This item is out of order, thus it has been moved.
+
+@ddel
+@xhang<@xterm<Accessibility_Check>
+Check the accessibility level of an entity or view.>
+
!ACATS test
Create a C-Test to check that either Program_Error is raised or that the
@@ -1160,6 +1186,107 @@
finished waiting for the termination of its dependent tasks raises
Program_Error.
+****************************************************************
+
+From: Randy Brukardt
+Date: Wednesday, November 3, 2004 7:54 PM
+
+AI-280 adds a number of checks on allocation after finalization of master
+or pool. There is no obvious check name in 11.5 to represent these checks;
+but it seems likely that these should be able to be suppressed.
+
+Should these have a check name? If so, what should it be?
+
+The best I could come up with is Finalized_Check or After_Finalization_Check
+but that seems to be discussing something to do with finalization. Other
+ideas were Allocation_Too_Late_Check or Baird_Bug_Check. :-)
+
+****************************************************************
+
+From: John Barnes
+Date: Thursday, November 4, 2004 2:23 AM
+
+Why not just Allocation_Check?
+
+****************************************************************
+
+From: Randy Brukardt
+Date: Thursday, November 4, 2004 5:48 PM
+
+OK, seems good.
+
+I've added the following before 11.5(20):
+
+Allocation_Check
+For an allocator, check that the master of any tasks has not yet finished
+waiting for tasks, and that the finalization of the collection has not
+started.
+
+I also moved Accessibility_Check so that the checks in this grouping are in
+alphabetical order (as the other groupings are).
+
+As this AI is in editorial review, and this is mainly an editorial change
+(we just forgot to define the check name for this, and probably other checks
+that we've defined), it will go directly to WG9 without further
+consideration by the ARG unless someone objects. (In which case, we'll
+withdraw the AI from WG9 and reconsider it in Atlanta.)
+
+****************************************************************
+
+From: Tucker Taft
+Date: Thursday, November 4, 2004 7:54 PM
+
+I might recommend:
+
+ For an allocator, check that the master of any task created by the
+ allocator has not already finished waiting for its dependents, and that
+ any finalization associated with the type of the allocator has not
+ already started.
+
+The term "collection" is not defined in the manual, as far as I know.
+I guess this is a gripe about AI-280 in general. It uses the
+term "collection" several times without defining it. I would rather
+not introduce the term unless we really need it. It will almost
+certainly get confused with "storage pool" in the user's mind.
+
+****************************************************************
+
+From: Randy Brukardt
+Date: Thursday, November 4, 2004 8:28 PM
+
+Don't forget that these are one-liners intended to be simple and
+non-normative. This already rather long for this section. (Of course, they
+shouldn't contradict the normative wording.)
+
+The term "finalization of the collection" was defined in the AI in
+7.6.1(11). It refers to a very specific action. "any finalization associated
+with the type of the allocator" is far too vague to be meaningful. It would
+be OK here as this isn't normative, but certainly not in the normative
+wording -- and it's way too wordy for this text. Of course, like all
+technical terms, it will be indexed in the index, probably both as
+"finalization of the collection" and "collection, finalization of".
+
+In any case, this wording is a simplified version of the normative wording
+of the AI. If you're saying that you have problems with the normative
+wording of the AI, that's fine but then we'll have to reopen the AI. And
+it's already in the AARM and I sure as heck don't want to take it out. The
+term "finalization of the collection" has been in every version of the AI, I
+believe, and certainly no one has complained about it before (I just checked
+all of the minutes on this AI).
+
+You could of course do an editorial review on the AI like you're supposed to
+anyway and make any suggestions. :-)
+
+The only change I made was to replace the second "tasks" with "dependents"
+so that the wording wasn't quite as confusing. But feel free to try again to
+produce a one-liner for this use.
+
+****************************************************************
+
+From: John Barnes
+Date: Friday, November 5, 2004 10:14 AM
+
+Well I'm happy with this despite what Tuck says.
****************************************************************
Questions? Ask the ACAA Technical Agent