aboutsummaryrefslogtreecommitdiff
path: root/doc/mailfromd.texi
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-09-19 09:59:03 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-09-19 09:59:03 +0000
commit16dedfd3996a3077ce9ee93ab4dd7b9e47d05cfb (patch)
treea5ad50dd3d492d6479f1a39a4ebadc61059f927e /doc/mailfromd.texi
parentf7db7631f4df8c6dcca5c1fef060634e8c62a6eb (diff)
downloadmailfromd-16dedfd3996a3077ce9ee93ab4dd7b9e47d05cfb.tar.gz
mailfromd-16dedfd3996a3077ce9ee93ab4dd7b9e47d05cfb.tar.bz2
Implement two stack growth policies.
* mfd/gram.y (pragma_stacksize): Implement two stack growth policies. * mfd/mailfromd.h (enum stack_expand_policy): New enum. (stack_expand_incr, stack_expand_policy): New global variables. * mfd/prog.c (stack_expand_incr) (stack_expand_policy): New global variables. * NEWS: Update. * doc/mailfromd.texi (stacksize): Document changes to pragma stacksize. * doc/values.texi (STACK-INCR): New value. git-svn-id: file:///svnroot/mailfromd/trunk@1676 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'doc/mailfromd.texi')
-rw-r--r--doc/mailfromd.texi46
1 files changed, 39 insertions, 7 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi
index 6532d747..57173265 100644
--- a/doc/mailfromd.texi
+++ b/doc/mailfromd.texi
@@ -4144,26 +4144,56 @@ database and its management.
@cindex stacksize, pragma
@cindex #pragma stacksize
The @code{stacksize} pragma sets the initial size of the run-time
-stack size, in words. The default size is @value{STACK-SIZE}. You may
-wish to increase this number if your configuration program uses
-recursive functions or does an excessive amount of string
-manipulations. Example syntax:
+stack size and may also define the policy of its growing, in case it
+becomes full. It takes one mandatory and one optional argument. The
+first argument gives the desired initial stack size, in words. It
+defaults to @value{STACK-SIZE}. You may wish to increase this number
+if your configuration program uses recursive functions or does an
+excessive amount of string manipulations. For example:
@smallexample
#pragma stacksize 7168
@end smallexample
@anchor{automatic stack resizing}
-@FIXME{Improve the description:}
When the @acronym{MFL} engine notices that there is no more stack space
available, it attempts to expand the stack. If this attempt succeeds, the
operation continues. Otherwise, a runtime error is reported and the
execution of the filter stops.
+@cindex stack growth policy
+@cindex growth policy, stack
+Optional second argument to @code{#pragma stacksize} defines growth
+policy for the stack. A positive number in its place is taken for the
+@dfn{expansion chunk} size. In this case, the stack will be grown in
+blocks that contain integer number of expansion chunks. The following
+example sets initial stack size to 10240, and expansion chunk size to
+2048 words:
+
+@smallexample
+#pragma stacksize 10240 2048
+@end smallexample
+
+This @dfn{incremental growth policy} is the default. The default
+chunk size is @value{STACK-INCR}.
+
+The word @samp{twice} used as second argument enables @dfn{exponential
+stack growth} policy:
+
+@smallexample
+#pragma stacksize 10240 twice
+@end smallexample
+
+In this case, when the run-time evaluator hits the stack size limit,
+it expands the stack to twice the size it had before. So, in the
+example above, the stack will be sequentially expanded to the
+following sizes: 20480, 40960, 81920, 163840.
+
If you are concerned about the execution time of your script, you
-may wish to avoid such reallocations. To help you find out the
+may wish to avoid stack reallocations. To help you find out the
optimal stack size, each time the stack is expanded,
-@command{mailfromd} issues a similar warning in its log file:
+@command{mailfromd} issues a warning in its log file, which looks like
+this:
@smallexample
warning: stack segment expanded, new size=8192
@@ -4858,11 +4888,13 @@ qualified domain name of the host where @command{mailfromd} is run.
Polling functions (@pxref{Polling functions}) set this variable before
returning. It contains the initial SMTP reply from the last polled
host.
+@end deftypevar
@deftypevar {Predefined Variable} string last_poll_helo
Polling functions (@pxref{Polling functions}) set this variable before
returning. It contains the reply to the @code{HELO} (@code{EHLO})
command, received from the last polled host.
+@end deftypevar
@deftypevar {Predefined Variable} string last_poll_host
Polling functions (@pxref{Polling functions}) set this variable before

Return to:

Send suggestions and report system problems to the System administrator.