Branch: Tag:

2008-11-19

2008-11-19 21:25:43 by Martin Stjernholm <mast@lysator.liu.se>

Reinstated the de facto semantic that freed objects are destructed
before every pike level call.

(Actually it's more reliable now since all sorts of function calls are
covered - previously it only applied to C function calls without
CALL_BUILTIN opcodes and programs in constants.)

Rev: src/interpret.h:1.177

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: interpret.h,v 1.176 2008/11/18 19:06:23 mast Exp $ + || $Id: interpret.h,v 1.177 2008/11/19 21:25:43 mast Exp $   */      #ifndef INTERPRET_H
704:    * 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() fast_check_threads_etc (6) + #define FAST_CHECK_THREADS_ON_CALL() do { \ +  if (++fast_check_threads_counter >= (1 << 6)) { \ +  fast_check_threads_counter = 0; \ +  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