[m-rev.] diff/for review: allow bootstrap in decldebug grades

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri May 20 10:35:31 AEST 2005


On 18-May-2005, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> There should be a comment somewhere describing why this
> is necessary, otherwise it's fine.

library/io.m:
	Add a comment about the chunk I committed earlier this week.

Zoltan.

Index: io.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.329
diff -u -b -r1.329 io.m
--- io.m	18 May 2005 05:25:58 -0000	1.329
+++ io.m	20 May 2005 00:22:20 -0000
@@ -3692,6 +3692,17 @@
 #endif
 ").
 
+	% Chunk_size gives the maximum number of recursive calls we want to
+	% allow in the binary_input_stream_foldl*_inner predicates. Without
+	% such a limit, the depth of recursion, which depends on the size of
+	% the file they read, will cause exhaustion of the det stack in debug
+	% grades, since there is no tail recursion in such grades.
+	%
+	% With this arrangement, the maximum number of stack frames needed
+	% to process a file of size N is N/1000 + 1000, the former being the
+	% number of frames of binary_input_stream_foldl*_chunk predicates,
+	% the latter being the max number of frames of the *_inner predicates.
+	%
 :- func chunk_size = int.
 
 chunk_size = 1000.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list