Skip to content

Commit

Permalink
CAMLRUNPARAM -> OCAMLRUNPARAM
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2570 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
Damien Doligez committed Nov 18, 1999
1 parent aeb4577 commit f9dafc4
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 8 deletions.
5 changes: 4 additions & 1 deletion asmrun/startup.c
Expand Up @@ -84,7 +84,10 @@ static void scanmult (char *opt, long unsigned int *var)

static void parse_camlrunparam(void)
{
char *opt = getenv ("CAMLRUNPARAM");
char *opt = getenv ("OCAMLRUNPARAM");

if (opt == NULL) opt = getenv ("CAMLRUNPARAM");

if (opt != NULL){
while (*opt != '\0'){
switch (*opt++){
Expand Down
58 changes: 54 additions & 4 deletions man/ocamlrun.m
Expand Up @@ -50,11 +50,17 @@
The following environment variable are also consulted:

.TP
.B CAMLRUNPARAM
.B OCAMLRUNPARAM
Set the garbage collection parameters.
(If
.B OCAMLRUNPARAM
is not set,
.B CAMLRUNPARAM
will be used instead.)
This variable must be a sequence of parameter specifications.
A parameter specification is an option letter followed by an =
sign and a decimal number. There are four options:
sign, a decimal number, and an optional multiplier. There are seven
options:
.TP
.BR s \ (minor_heap_size)
Size of the minor heap.
Expand All @@ -65,9 +71,53 @@
.BR o \ (space_overhead)
The major GC speed setting.
.TP
.BR O \ (max_overhead)
The heap compaction trigger setting.
.TP
.BR l \ (stack_limit)
The limit (in words) of the stack size.
.TP
.BR h
The initial size of the major heap (in words).
.TP
.BR v \ (verbose)
Whether to print GC messages or not. 0 is
false; 1 is true; other values may give unexpected results.
What GC messages to print to stderr. This is a sum of values selected
from the following:
.TP
.BR 1
Start of major GC cycle.
.TP
.BR 2
Minor collection and major GC slice.
.TP
.BR 4
Growing and shrinking of the heap.
.TP
.BR 8
Resizing of stacks and memory manager tables.
.TP
.BR 16
Heap compaction.
.TP
.BR 32
Change of GC parameters.
.TP
.BR 64
Computation of major GC slice size.

The multiplier is
.B k
,
.B M
, or
.B G
, for multiplication by 2^10, 2^20, and 2^30 respectively.
For example, on a 32-bit machine under bash, the command
.B export OCAMLRUNPARAM='s=256k,v=1'
tells a subsequent
.B ocamlrun
to set its initial minor heap size to 1 megabyte and to print
a message at the start of each major GC cycle.

.TP
.B PATH
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile
Expand Up @@ -22,7 +22,7 @@ CAMLYACC=../yacc/ocamlyacc
CAMLLEX=../boot/ocamlrun ../lex/ocamllex
CAMLDEP=../boot/ocamlrun ../tools/ocamldep
CAMLRUN=../byterun/ocamlrun
CODERUNPARAMS=CAMLRUNPARAM='o=100'
CODERUNPARAMS=OCAMLRUNPARAM='o=100'

BYTE_EXE=fib.byt takc.byt taku.byt sieve.byt quicksort.byt quicksort.fast.byt \
fft.byt fft.fast.byt soli.byt soli.fast.byt boyer.byt kb.byt \
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile.nt
Expand Up @@ -22,7 +22,7 @@ CAMLYACC=..\yacc\ocamlyacc
CAMLLEX=..\boot\ocamlrun ..\lex\ocamllex
CAMLDEP=..\boot\ocamlrun ..\tools\ocamldep
CAMLRUN=..\byterun\ocamlrun
CODERUNPARAMS=CAMLRUNPARAM='o=100'
CODERUNPARAMS=OCAMLRUNPARAM='o=100'

BYTE_EXE=fib.byt takc.byt taku.byt sieve.byt quicksort.byt quicksort.fast.byt \
fft.byt fft.fast.byt soli.byt soli.fast.byt boyer.byt kb.byt \
Expand Down
2 changes: 1 addition & 1 deletion test/Moretest/Makefile
Expand Up @@ -19,7 +19,7 @@ CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib
OPTFLAGS=-S
CAMLDEP=../../boot/ocamlrun ../../tools/ocamldep
CAMLRUN=../../byterun/ocamlrun
CODERUNPARAMS=CAMLRUNPARAM='o=100'
CODERUNPARAMS=OCAMLRUNPARAM='o=100'

callback.byt: callback.cmo callbackprim.o
$(CAMLC) -o callback.byt -custom callback.cmo callbackprim.o ../../otherlibs/unix/libunix.a
Expand Down

0 comments on commit f9dafc4

Please sign in to comment.