~ chicken-core (chicken-5) b1907c5ab8b42afb781685f02adba2dcd4f11d5f
commit b1907c5ab8b42afb781685f02adba2dcd4f11d5f Author: felix <felix@call-with-current-continuation.org> AuthorDate: Thu Nov 10 11:11:36 2011 +0100 Commit: Christian Kellermann <ckeen@pestilenz.org> CommitDate: Fri Nov 11 14:21:50 2011 +0100 use different default stack-sizes on 32/64 bit platforms stack-resizing should not be done in compiled files by default, also deprecate -heap-initial-size, -heap-growth and -heap-shirnkage options Signed-off-by: Christian Kellermann <ckeen@pestilenz.org> diff --git a/Makefile.mingw b/Makefile.mingw index 1f075439..45feda2b 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -178,9 +178,6 @@ endif echo #ifndef C_INSTALL_MORE_STATIC_LIBS >>$@ echo # define C_INSTALL_MORE_STATIC_LIBS "$(LIBRARIES)" >>$@ echo #endif >>$@ - echo #ifndef C_DEFAULT_TARGET_STACK_SIZE >>$@ - echo # define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY) >>$@ - echo #endif >>$@ echo #ifndef C_DEFAULT_TARGET_HEAP_SIZE >>$@ echo # define C_DEFAULT_TARGET_HEAP_SIZE 0 >>$@ echo #endif >>$@ diff --git a/batch-driver.scm b/batch-driver.scm index 42550996..1bd4f678 100644 --- a/batch-driver.scm +++ b/batch-driver.scm @@ -84,9 +84,6 @@ (profile-name (and-let* ((pn (memq 'profile-name options))) (cadr pn))) (hsize (memq 'heap-size options)) - (hisize (memq 'heap-initial-size options)) - (hgrowth (memq 'heap-growth options)) - (hshrink (memq 'heap-shrinkage options)) (kwstyle (memq 'keyword-style options)) (uses-units '()) (uunit (memq 'unit options)) @@ -341,20 +338,11 @@ (when (memq 'compile-syntax options) (set! ##sys#enable-runtime-macros #t) ) (set! target-heap-size - (if hsize - (arg-val (option-arg hsize)) - (and-let* ([hsize default-default-target-heap-size] - [(not (zero? hsize))] ) - hsize) ) ) - (set! target-initial-heap-size (and hisize (arg-val (option-arg hisize)))) - (set! target-heap-growth (and hgrowth (arg-val (option-arg hgrowth)))) - (set! target-heap-shrinkage (and hshrink (arg-val (option-arg hshrink)))) + (and hsize + (arg-val (option-arg hsize)))) (set! target-stack-size - (if ssize - (arg-val (option-arg ssize)) - (and-let* ([ssize default-default-target-stack-size] - [(not (zero? ssize))] ) - ssize) ) ) + (and ssize + (arg-val (option-arg ssize)))) (set! emit-trace-info (not (memq 'no-trace options))) (set! disable-stack-overflow-checking (memq 'disable-stack-overflow-checks options)) (set! bootstrap-mode (feature? #:chicken-bootstrap)) diff --git a/c-backend.scm b/c-backend.scm index 32dab846..18e013ef 100644 --- a/c-backend.scm +++ b/c-backend.scm @@ -814,15 +814,9 @@ (when disable-stack-overflow-checking (gen #t "C_disable_overflow_check=1;") ) (unless unit-name - (cond [target-initial-heap-size - (gen #t "C_set_or_change_heap_size(" target-initial-heap-size ",1);") ] - [target-heap-size - (gen #t "C_set_or_change_heap_size(" target-heap-size ",1);" - #t "C_heap_size_is_fixed=1;") ] ) - (when target-heap-growth - (gen #t "C_heap_growth=" target-heap-growth #\;) ) - (when target-heap-shrinkage - (gen #t "C_heap_shrinkage=" target-heap-shrinkage #\;) ) + (when target-heap-size + (gen #t "C_set_or_change_heap_size(" target-heap-size ",1);" + #t "C_heap_size_is_fixed=1;")) (when target-stack-size (gen #t "C_resize_stack(" target-stack-size ");") ) ) (gen #t "C_check_nursery_minimum(" demand ");" diff --git a/c-platform.scm b/c-platform.scm index 0e987546..5d69bcdf 100644 --- a/c-platform.scm +++ b/c-platform.scm @@ -104,7 +104,8 @@ prelude postlude prologue epilogue nursery extend feature no-feature types emit-import-library emit-inline-file static-extension consult-inline-file emit-type-file - heap-growth heap-shrinkage heap-initial-size ffi-define ffi-include-path) ) + heap-growth heap-shrinkage heap-initial-size ; DEPRECATED + ffi-define ffi-include-path) ) ;;; Standard and extended bindings: diff --git a/compiler-namespace.scm b/compiler-namespace.scm index a23d31d4..819aae11 100644 --- a/compiler-namespace.scm +++ b/compiler-namespace.scm @@ -82,7 +82,6 @@ default-debugging-declarations default-declarations default-default-target-heap-size - default-default-target-stack-size default-extended-bindings default-optimization-iterations default-optimization-passes @@ -277,11 +276,8 @@ stringify substitution-table symbolify - target-heap-growth - target-heap-shrinkage target-heap-size target-include-file - target-initial-heap-size target-stack-size toplevel-lambda-id toplevel-scope diff --git a/compiler.scm b/compiler.scm index d907f633..83de2d2a 100644 --- a/compiler.scm +++ b/compiler.scm @@ -279,15 +279,8 @@ (define-inline (gensym-f-id) (gensym 'f_)) -(eval-when (eval) - (define installation-home #f) - (define default-target-heap-size #f) - (define default-target-stack-size #f) ) - -(eval-when (load) - (define-foreign-variable installation-home c-string "C_INSTALL_SHARE_HOME") - (define-foreign-variable default-target-heap-size int "C_DEFAULT_TARGET_HEAP_SIZE") - (define-foreign-variable default-target-stack-size int "C_DEFAULT_TARGET_STACK_SIZE") ) +(define-foreign-variable installation-home c-string "C_INSTALL_SHARE_HOME") +(define-foreign-variable default-target-heap-size int "C_DEFAULT_TARGET_HEAP_SIZE") (define-constant foreign-type-table-size 301) (define-constant analysis-database-size 3001) @@ -313,7 +306,6 @@ (define block-compilation #f) (define line-number-database-size default-line-number-database-size) (define target-heap-size #f) -(define target-initial-heap-size #f) (define target-stack-size #f) (define optimize-leaf-routines #f) (define emit-profile #f) @@ -344,12 +336,6 @@ (define enable-specialization #f) -;;; These are here so that the backend can access them: - -(define default-default-target-heap-size default-target-heap-size) -(define default-default-target-stack-size default-target-stack-size) - - ;;; Other global variables: (define verbose-mode #f) diff --git a/csc.scm b/csc.scm index 11bbff0d..8afbdf63 100644 --- a/csc.scm +++ b/csc.scm @@ -148,7 +148,9 @@ -optimize-level -include-path -database-size -extend -prelude -postlude -prologue -epilogue -inline-limit -profile-name -emit-inline-file -types -emit-type-file - -feature -debug-level -heap-growth -heap-shrinkage -heap-initial-size -consult-inline-file + -feature -debug-level + -heap-growth -heap-shrinkage -heap-initial-size ; DEPRECATED + -consult-inline-file -emit-import-library -no-feature)) @@ -403,9 +405,6 @@ Usage: #{csc} FILENAME | OPTION ... -unit NAME compile file as a library unit -uses NAME declare library unit as used. -heap-size NUMBER specifies heap-size of compiled executable - -heap-initial-size NUMBER specifies heap-size at startup time - -heap-growth PERCENTAGE specifies growth-rate of expanding heap - -heap-shrinkage PERCENTAGE specifies shrink-rate of contracting heap -nursery NUMBER -stack-size NUMBER specifies nursery size of compiled executable diff --git a/defaults.make b/defaults.make index 9de2b4c9..03a014d8 100644 --- a/defaults.make +++ b/defaults.make @@ -389,9 +389,6 @@ endif echo "#ifndef C_INSTALL_MORE_STATIC_LIBS" >>$@ echo "# define C_INSTALL_MORE_STATIC_LIBS \"$(LIBRARIES)\"" >>$@ echo "#endif" >>$@ - echo "#ifndef C_DEFAULT_TARGET_STACK_SIZE" >>$@ - echo "# define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY)" >>$@ - echo "#endif" >>$@ echo "#ifndef C_DEFAULT_TARGET_HEAP_SIZE" >>$@ echo "# define C_DEFAULT_TARGET_HEAP_SIZE 0" >>$@ echo "#endif" >>$@ diff --git a/manual/Using the compiler b/manual/Using the compiler index a3470f24..9d9253e8 100644 --- a/manual/Using the compiler +++ b/manual/Using the compiler @@ -68,12 +68,6 @@ the source text should be read from standard input. ; -heap-size NUMBER : Sets a fixed heap size of the generated executable to {{NUMBER}} bytes. The parameter may be followed by a {{M}} ({{m}}) or {{K}} ({{k}}) suffix which stand for mega- and kilobytes, respectively. The default heap size is 5 kilobytes. Note that only half of it is in use at every given time. -; -heap-initial-size NUMBER : Sets the size that the heap of the compiled application should have at startup time. - -; -heap-growth PERCENTAGE : Sets the heap-growth rate for the compiled program at compile time (see: {{-:hg}}). - -; -heap-shrinkage PERCENTAGE : Sets the heap-shrinkage rate for the compiled program at compile time (see: {{-:hs}}). - ; -help : Print a summary of available options and the format of the command line parameters and exit the compiler. ; -ignore-repository : Do not load any extensions from the repository (treat repository as empty). Also do not consult compiled (only interpreted) import libraries in {{import}} forms. diff --git a/runtime.c b/runtime.c index a6b2d35d..09b1393b 100644 --- a/runtime.c +++ b/runtime.c @@ -131,7 +131,12 @@ extern void _C_do_apply_hack(void *proc, C_word *args, int count) C_noret; #define RELAX_MULTIVAL_CHECK -#define DEFAULT_STACK_SIZE 64000 +#ifdef C_SIXTY_FOUR +# define DEFAULT_STACK_SIZE (1024 * 1024) +#else +# define DEFAULT_STACK_SIZE (256 * 1024) +#endif + #define DEFAULT_SYMBOL_TABLE_SIZE 2999 #define DEFAULT_HEAP_SIZE 500000 #define MINIMAL_HEAP_SIZE 500000 diff --git a/support.scm b/support.scm index 28c950b9..8bf2b6d0 100644 --- a/support.scm +++ b/support.scm @@ -1685,9 +1685,6 @@ Usage: chicken FILENAME OPTION ... -unit NAME compile file as a library unit -uses NAME declare library unit as used. -heap-size NUMBER specifies heap-size of compiled executable - -heap-initial-size NUMBER specifies heap-size at startup time - -heap-growth PERCENTAGE specifies growth-rate of expanding heap - -heap-shrinkage PERCENTAGE specifies shrink-rate of contracting heap -nursery NUMBER -stack-size NUMBER specifies nursery size of compiled executable -extend FILENAME load file before compilation commencesTrap