make the default stack, heap and trail sizes configurable, and have the default show at the -? message
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@296 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
b9b8b3d3be
commit
02b0f3be03
29
config.h.in
29
config.h.in
@ -94,6 +94,35 @@
|
||||
/* Define the standard type of a float argument to a function */
|
||||
#define FAFloat double /* manual */
|
||||
|
||||
/* Set the minimum and default heap, trail and stack size */
|
||||
#undef MinTrailSpace
|
||||
#undef MinStackSpace
|
||||
#undef MinHeapSpace
|
||||
|
||||
#undef UsrTrailSpace
|
||||
#undef UsrStackSpace
|
||||
#undef UsrHeapSpace
|
||||
|
||||
#if (UsrTrailSpace > MinTrailSpace)
|
||||
#define DefTrailSpace UsrTrailSpace
|
||||
#else
|
||||
#define DefTrailSpace MinTrailSpace
|
||||
#endif
|
||||
|
||||
#if (UsrStackSpace > MinStackSpace)
|
||||
#define DefStackSpace UsrStackSpace
|
||||
#else
|
||||
#define DefStackSpace MinStackSpace
|
||||
#endif
|
||||
|
||||
#if (UsrHeapSpace > MinHeapSpace)
|
||||
#define DefHeapSpace UsrHeapSpace
|
||||
#else
|
||||
#define DefHeapSpace MinHeapSpace
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Define return type for signal */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
|
56
configure.in
56
configure.in
@ -1,6 +1,9 @@
|
||||
dnl
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
|
||||
AC_PREREQ(2.13)
|
||||
|
||||
AC_INIT(console/yap.c)
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
@ -66,6 +69,54 @@ AC_ARG_WITH(readline,
|
||||
fi,
|
||||
[yap_cv_readline=yes])
|
||||
|
||||
AC_ARG_WITH(heap-space,
|
||||
[ --with-heap-space[=space] default heap size in Kbytes],
|
||||
if test $withval = yes; then
|
||||
yap_cv_heap_space=0
|
||||
elif test $withval = no; then
|
||||
yap_cv_heap_space=0
|
||||
else
|
||||
yap_cv_heap_space=$withval
|
||||
fi,
|
||||
[yap_cv_heap_space=0])
|
||||
|
||||
AC_ARG_WITH(stack-space,
|
||||
[ --with-stack-space[=space] default stack size in Kbytes],
|
||||
if test $withval = yes; then
|
||||
yap_cv_stack_space=0
|
||||
elif test $withval = no; then
|
||||
yap_cv_stack_space=0
|
||||
else
|
||||
yap_cv_stack_space=$withval
|
||||
fi,
|
||||
[yap_cv_stack_space=0])
|
||||
|
||||
AC_ARG_WITH(trail-space,
|
||||
[ --with-trail-space[=space] default trail size in Kbytes],
|
||||
if test $withval = yes; then
|
||||
yap_cv_trail_space=0
|
||||
elif test $withval = no; then
|
||||
yap_cv_trail_space=0
|
||||
else
|
||||
yap_cv_trail_space=$withval
|
||||
fi,
|
||||
[yap_cv_trail_space=0])
|
||||
|
||||
if test $tabling = yes -o $orparallelism = yes
|
||||
then
|
||||
AC_DEFINE(MinHeapSpace, (300*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinStackSpace,(300*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinTrailSpace,( 48*SIZEOF_INT_P))
|
||||
else
|
||||
AC_DEFINE(MinHeapSpace, (200*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinStackSpace,(200*SIZEOF_INT_P))
|
||||
AC_DEFINE(MinTrailSpace,( 32*SIZEOF_INT_P))
|
||||
fi
|
||||
|
||||
eval "AC_DEFINE(UsrHeapSpace,($yap_cv_heap_space))"
|
||||
eval "AC_DEFINE(UsrStackSpace,($yap_cv_stack_space))"
|
||||
eval "AC_DEFINE(UsrTrailSpace,($yap_cv_trail_space))"
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
AC_DEFINE_UNQUOTED(HOST_ALIAS,"${host_alias}")
|
||||
@ -280,11 +331,12 @@ case $target_os in
|
||||
*hpux*)
|
||||
#do not use the first memory quadrant
|
||||
AC_DEFINE(FORCE_SECOND_QUADRANT)
|
||||
#this tells ld to export all non-static symbols,
|
||||
#otherwise no external predicates.
|
||||
M4="/usr/bin/m4"
|
||||
SHLIB_INTERFACE="load_shl.o"
|
||||
if test $CC = cc -o $CC = c89
|
||||
then
|
||||
#this tells ld to export all non-static symbols,
|
||||
#otherwise no external predicates.
|
||||
SHLIB_LD="ld -b -E ${LDFLAGS}"
|
||||
DO_SECOND_LD=""
|
||||
SHLIB_SUFFIX=".sl"
|
||||
|
@ -224,9 +224,9 @@ parse_yap_arguments(int argc, char *argv[], yap_init_args *init_args)
|
||||
fprintf(stderr," -? Shows this screen\n");
|
||||
fprintf(stderr," -b Boot file (%s)\n", StartUpFile);
|
||||
fprintf(stderr," -l Prolog file\n");
|
||||
fprintf(stderr," -h Heap area in Kbytes\n");
|
||||
fprintf(stderr," -s Stack area in Kbytes\n");
|
||||
fprintf(stderr," -t Trail area in Kbytes\n");
|
||||
fprintf(stderr," -h Heap area in Kbytes (default: %d)\n", DefHeapSpace);
|
||||
fprintf(stderr," -s Stack area in Kbytes (default: %d)\n", DefStackSpace);
|
||||
fprintf(stderr," -t Trail area in Kbytes (default: %d)\n", DefTrailSpace);
|
||||
fprintf(stderr," -w YapOr option: Number of workers (default: %d)\n", init_args->NumberWorkers);
|
||||
fprintf(stderr," -sl YapOr option: Loop scheduler executions before look for hiden shared work (default: %d)\n", init_args->SchedulerLoop);
|
||||
fprintf(stderr," -d YapOr option: Value of delayed release of load (default: %d)\n", init_args->DelayedReleaseLoad);
|
||||
|
28
m4/Yap.h.m4
28
m4/Yap.h.m4
@ -10,7 +10,7 @@
|
||||
* File: Yap.h.m4 *
|
||||
* mods: *
|
||||
* comments: main header file for YAP *
|
||||
* version: $Id: Yap.h.m4,v 1.16 2002-01-01 05:26:25 vsc Exp $ *
|
||||
* version: $Id: Yap.h.m4,v 1.17 2002-01-15 17:55:50 stasinos Exp $ *
|
||||
*************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
@ -771,32 +771,6 @@ typedef enum {
|
||||
extern prolog_exec_mode PrologMode;
|
||||
extern int CritLocks;
|
||||
|
||||
#if SIZEOF_INT_P==4
|
||||
#if defined(YAPOR) || defined(TABLING)
|
||||
#define MinTrailSpace 192
|
||||
#define MinStackSpace 1200
|
||||
#define MinHeapSpace 1200
|
||||
#else
|
||||
#define MinTrailSpace 128
|
||||
#define MinStackSpace 800
|
||||
#define MinHeapSpace 800
|
||||
#endif /* YAPOR || TABLING */
|
||||
#else
|
||||
#if defined(YAPOR) || defined(TABLING)
|
||||
#define MinTrailSpace 384
|
||||
#define MinStackSpace 2400
|
||||
#define MinHeapSpace 2400
|
||||
#else
|
||||
#define MinTrailSpace 256
|
||||
#define MinStackSpace 1600
|
||||
#define MinHeapSpace 1600
|
||||
#endif /* YAPOR || TABLING */
|
||||
#endif
|
||||
|
||||
#define DefTrailSpace MinTrailSpace
|
||||
#define DefStackSpace MinStackSpace
|
||||
#define DefHeapSpace MinHeapSpace
|
||||
|
||||
/************** Access to yap initial arguments ***************************/
|
||||
|
||||
extern char **yap_args;
|
||||
|
Reference in New Issue
Block a user