summaryrefslogtreecommitdiffstats
path: root/byterun/gc_ctrl.c
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2012-07-26 19:21:54 +0000
committerDamien Doligez <damien.doligez-inria.fr>2012-07-26 19:21:54 +0000
commit0c3a7de5079529bc99cbc9e68806f1a7021d94ef (patch)
tree3b973b6db6313c9bb2993b77c925c0dc8b457f7a /byterun/gc_ctrl.c
parent229044d83a940d855fd9590d9aa76596f8c1a8b9 (diff)
merge changes from 4.00 branching to 4.00.0 (part 1)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12784 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/gc_ctrl.c')
-rw-r--r--byterun/gc_ctrl.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/byterun/gc_ctrl.c b/byterun/gc_ctrl.c
index b5c436679..2ae3165d9 100644
--- a/byterun/gc_ctrl.c
+++ b/byterun/gc_ctrl.c
@@ -356,21 +356,12 @@ static intnat norm_minsize (intnat s)
return s;
}
-static intnat norm_policy (intnat p)
-{
- if (p >= 0 && p <= 1){
- return p;
- }else{
- return 1;
- }
-}
-
CAMLprim value caml_gc_set(value v)
{
uintnat newpf, newpm;
asize_t newheapincr;
asize_t newminsize;
- uintnat newpolicy;
+ uintnat oldpolicy;
caml_verb_gc = Long_val (Field (v, 3));
@@ -396,10 +387,11 @@ CAMLprim value caml_gc_set(value v)
caml_gc_message (0x20, "New heap increment size: %luk bytes\n",
caml_major_heap_increment/1024);
}
- newpolicy = norm_policy (Long_val (Field (v, 6)));
- if (newpolicy != caml_allocation_policy){
- caml_gc_message (0x20, "New allocation policy: %d\n", newpolicy);
- caml_set_allocation_policy (newpolicy);
+ oldpolicy = caml_allocation_policy;
+ caml_set_allocation_policy (Long_val (Field (v, 6)));
+ if (oldpolicy != caml_allocation_policy){
+ caml_gc_message (0x20, "New allocation policy: %d\n",
+ caml_allocation_policy);
}
/* Minor heap size comes last because it will trigger a minor collection