This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] AI-302


Tested on i686-linux, committed on trunk.

Update Ada containers to latest AI-302 draft, which can be found at:
http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-20302.TXT?rev=1.27

Also, the previous implementation of Generic_Insert_Post was really a hold-over
from a very early design, when the container created a dummy node that served
as the previous node of first and next node of last. A dummy node is no longer
allocated and so when you fall off the end the value is null.
The generic operations that imported an instantiation of Generic_Insert_Post
as a generic formal have also been fixed to match its new signature.
Passing a flag to indicate explicitly which child the new node should be also
has the benefit that it simplifies the implementation of Generic_Insert_Post.
Previously it had to make some tests to determine which child, but that only
duplicated tests already performed by the caller, who can now tell
Generic_Insert_Post directly which child.

In one of the earlier AI-302 drafts, the "Success" parameter of the
conditional insertion operation Insert was renamed to "Inserted", the name
preferred by members of the development community using early versions of the
container library.  The Generic_Keys package is used to implement container
Insert, and so the parameter name was changed to match.

The new algorithm is not as conservative as the old one, and now takes
advantage of the fact that the tree can have multiple keys that are equivalent.
There are now fewer tests and (more importantly) fewer searches from the root,
and hence the algorithm should be more efficient.

2006-10-31  Matt Heaney  <heaney@adacore.com>

	* a-crbtgo.ads: Commented each subprogram

	* a-crbtgo.adb: Added reference to book from which algorithms were
	adapted.

        * a-crbtgk.ads, a-crbtgk.adb (Generic_Insert_Post): pass flag to
	indicate which child.
	(Generic_Conditional_Insert): changed parameter name from "Success" to
	"Inserted".
	(Generic_Unconditional_Insert_With_Hint): improved algorithm

	* a-coorse.adb (Replace_Element): changed parameter name in call to
	conditional insert operation.

	* a-convec.adb, a-coinve.adb (Insert): removed obsolete comment

	* a-cohama.adb (Iterate): manipulate busy-bit here, instead of in
	Generic_Iteration

	* a-ciorse.adb (Replace_Element): changed parameter name in call to
	conditional insert operation.

	* a-cihama.adb (Iterate): manipulate busy-bit here, instead of in
	Generic_Iteration.

	* a-cidlli.ads, a-cidlli.adb (Splice): Position param is now mode in
	instead of mode inout.

	* a-chtgop.adb (Adjust): modified comments to reflect current AI-302
	draft
	(Generic_Read): preserve existing buckets array if possible
	(Generic_Write): don't send buckets array length anymore

	* a-cdlili.ads, a-cdlili.adb (Splice): Position param is now mode in
	instead of mode inout.

	* a-cihase.adb (Difference): iterate over smaller of Tgt and Src sets
	(Iterate): manipulate busy-bit here, instead of in Generic_Iteration

	* a-cohase.adb (Difference): iterate over smaller of Tgt and Src sets
	(Iterate): manipulate busy-bit here, instead of in Generic_Iteration
	(Replace_Element): local operation is now an instantiation

	* a-chtgke.ads, a-chtgke.adb (Generic_Conditional_Insert): manually
	check current length.
	(Generic_Replace_Element): new operation

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]