Branch: Tag:

2003-02-01

2003-02-01 15:37:23 by Martin Stjernholm <mast@lysator.liu.se>

Enabled some consistency checks in the gc when compiled without rtldebug
(only activated on debug level 1 or higher). Always define _verify_internals
to be able to use this. Made it possible to turn on trace messages for the
gc only with trace(1,"gc") (intended to be compatible with a facility based
trace system in 7.5).

Rev: src/array.c:1.134
Rev: src/builtin.cmod:1.103
Rev: src/builtin_functions.c:1.455
Rev: src/gc.c:1.192
Rev: src/gc.h:1.94
Rev: src/mapping.c:1.158
Rev: src/multiset.c:1.61
Rev: src/object.c:1.213
Rev: src/program.c:1.467

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin.cmod,v 1.102 2003/01/08 13:59:24 grubba Exp $ + || $Id: builtin.cmod,v 1.103 2003/02/01 15:37:22 mast Exp $   */      #include "global.h"
31:   #include "builtin_functions.h"   #include "fsort.h"   #include "port.h" + #include "gc.h"      /*! @decl array(array(int|string)) describe_program(program p)    *! @belongs Debug
329:    *!    *! See the @tt{-t@} command-line option for more information.    */ - PIKEFUN int trace(int t) + PIKEFUN int trace(int level, void|string facility)    efun;    optflags OPT_SIDE_EFFECT;   { -  pop_n_elems(args); -  push_int(t_flag); -  t_flag=t; +  INT32 old_level; +  if (facility) { +  struct pike_string *gc_str; +  if (facility->type != T_STRING) +  SIMPLE_BAD_ARG_ERROR("trace", 2, "void|string"); +  MAKE_CONSTANT_SHARED_STRING(gc_str, "gc"); +  if (facility->u.string == gc_str) { +  free_string(gc_str); +  old_level = gc_trace; +  gc_trace = level;    } -  +  else { +  free_string(gc_str); +  bad_arg_error("trace", Pike_sp-args, args, 2, +  "trace facility identifier", Pike_sp-args+1, +  "Bad argument 2 to trace(). Unknown trace facility."); +  } +  } +  else { +  old_level = t_flag; +  t_flag = gc_trace = level; +  } +  RETURN old_level; + }      /*! @decl string ctime(int timestamp)    *!