pike.git / src / interpret.h

version» Context lines:

pike.git/src/interpret.h:1:   /*   || 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: interpret.h,v 1.180 2009/04/01 20:26:37 mast Exp $ + || $Id: interpret.h,v 1.181 2010/03/24 20:47:54 mast Exp $   */      #ifndef INTERPRET_H   #define INTERPRET_H      #include "global.h"   #include "program.h"   #include "pike_error.h"   #include "object.h"   #include "pike_rusage.h"
pike.git/src/interpret.h:680:    } \    } \    SAFE_APPLY_MASTER(FUN, ARGS); \    } while(0)         #ifdef INTERNAL_PROFILING   PMOD_EXPORT extern unsigned long evaluator_callback_calls;   #endif    - #define check_threads_etc() do { \ + #define low_check_threads_etc() do { \    DO_IF_INTERNAL_PROFILING (evaluator_callback_calls++); \    call_callback(& evaluator_callbacks, NULL); \   }while(0)    -  + #define check_threads_etc() do { \ +  DO_IF_DEBUG (if (Pike_interpreter.trace_level > 2) \ +  fprintf (stderr, "- thread yield point\n")); \ +  low_check_threads_etc(); \ +  } while (0) +    extern int fast_check_threads_counter;      #define fast_check_threads_etc(X) do { \ -  +  DO_IF_DEBUG (if (Pike_interpreter.trace_level > 2) \ +  fprintf (stderr, "- thread yield point\n")); \    if (++fast_check_threads_counter >= (1 << (X))) { \    fast_check_threads_counter = 0; \ -  check_threads_etc(); \ +  low_check_threads_etc(); \    } \    } while(0)      /* Used before any sort of pike level function call. This covers most    * code paths. An interval with magnitude 6 on a 2 GHz AMD 64 averages    * on 1000-3000 check_threads_etc calls per second in mixed code, but    * it can vary greatly - from 0 to 30000+ calls/sec. In a test case    * with about 22000 calls/sec, it took 0.042% of the cpu. */   #define FAST_CHECK_THREADS_ON_CALL() do { \ -  +  DO_IF_DEBUG (if (Pike_interpreter.trace_level > 2) \ +  fprintf (stderr, "- thread yield point\n")); \    if (++fast_check_threads_counter >= (1 << 6)) { \    fast_check_threads_counter = 0; \ -  check_threads_etc(); \ +  low_check_threads_etc(); \    } \    else if (objects_to_destruct) \    /* De facto pike semantics requires that freed objects are */ \    /* destructed before function calls. Otherwise done through */ \    /* evaluator_callbacks. */ \    destruct_objects_to_destruct_cb(); \    } while (0)      /* Used before any sort of backward branch. This is only a safeguard    * for some corner cases with loops without calls - not relevant in