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] Improvements to Ada.Strings.Search.Count/Index


This patch makes two changes to the Count and Index routines which are
shared by the various string packages. First, the code no longer makes
a local copy on the stack, which could lead to unbounded stack usage
in the run-time. Second, in the unmapped case (map = identity), the
search is on the string itself not on a copy, speeding things up.

No test, since no change in functionality (the ACATS tests have exhaustive
tests of these two routines).

Tested on x86_64-pc-linux-gnu, committed on trunk

2009-06-24  Robert Dewar  <dewar@adacore.com>

	* a-strsea.adb (Count): Avoid local copy on stack, speed up unmapped
	case.
	(Index): Ditto.

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]