pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:598:
}, { \ SET_SVAL(get, T_FLOAT, 0, float_number, \ DO_NOT_WARN ((FLOAT_TYPE) VAR)); \ }); HANDLE_PARAM ("enabled", { if (TYPEOF(*set) != T_INT || set->u.integer < -1 || set->u.integer > 1) SIMPLE_BAD_ARG_ERROR ("Pike.gc_parameters", 1, "integer in the range -1..1 for 'enabled'"); if (gc_enabled != set->u.integer) {
-
if (gc_enabled > 0)
-
gc_
enabled
=
set
->u.integer;
-
else
{
-
gc_
enabled
=
1;
-
if (
alloc_threshold =
=
GC
_
MAX_ALLOC_THRESHOLD)
-
alloc_threshold = GC_
MIN
_ALLOC_THRESHOLD;
+
if (gc_enabled > 0)
{
+
/* Disabling automatic
gc
- save the old alloc
_
threshold
and
set
it to
+
*
the
maximum
value
to
avoid
getting
gc_
evaluator_callback
added.
*/
+
saved_
alloc_threshold =
alloc
_
threshold;
+
alloc_threshold = GC_
MAX
_ALLOC_THRESHOLD;
}
-
+
else if (set->u.integer > 0) {
+
/* Enabling automatic gc - restore the old alloc_threshold. If the
+
* gc interval has gotten longer than it should be then the
+
* multiplier calculation in do_gc should compensate. */
+
alloc_threshold = saved_alloc_threshold;
}
-
+
gc_enabled = set->u.integer;
+
}
}, { SET_SVAL(get, T_INT, NUMBER_NUMBER, integer, gc_enabled); }); HANDLE_FLOAT_FACTOR ("garbage_ratio_low", gc_garbage_ratio_low); HANDLE_FLOAT_FACTOR ("time_ratio", gc_time_ratio); HANDLE_FLOAT_FACTOR ("garbage_ratio_high", gc_garbage_ratio_high); HANDLE_FLOAT_FACTOR ("min_gc_time_ratio", gc_min_time_ratio); HANDLE_FLOAT_FACTOR ("average_slowness", gc_average_slowness); #undef HANDLE_PARAM