Reading Gauche/Reading Gauche 0.9/gc/finalize.c/GC_notify_or_invoke_finalizers


Top / Reading Gauche / Reading Gauche 0.9 / gc / finalize.c / GC_notify_or_invoke_finalizers

GC_notify_or_invoke_finalizers

概要

ひら終了後、作成予定。

void GC_notify_or_invoke_finalizers(void)
{
   /* This is a convenient place to generate backtraces if appropriate, */
   /* since that code is not callable with the allocation lock.	 */
#   if defined(KEEP_BACK_PTRS) || defined(MAKE_BACK_GRAPH)
     static word last_back_trace_gc_no = 1;	/* Skip first one. */

     if (GC_gc_no > last_back_trace_gc_no) {
	word i;
 
#	ifdef KEEP_BACK_PTRS
	  LOCK();
 	  /* Stops when GC_gc_no wraps; that's OK.	*/
	  last_back_trace_gc_no = (word)(-1);  /* disable others. */
	  for (i = 0; i < GC_backtraces; ++i) {
	      /* FIXME: This tolerates concurrent heap mutation,	*/
	      /* which may cause occasional mysterious results.		*/
	      /* We need to release the GC lock, since GC_print_callers	*/
	      /* acquires it.  It probably shouldn't.			*/
	      UNLOCK();
	      GC_generate_random_backtrace_no_gc();
	      LOCK();
	  }
	  last_back_trace_gc_no = GC_gc_no;
	  UNLOCK();
#	endif
#       ifdef MAKE_BACK_GRAPH
	  if (GC_print_back_height)
           GC_print_back_graph_stats();
#	endif
     }
#   endif
   if (GC_finalize_now == 0) return;
   if (!GC_finalize_on_demand) {
	(void) GC_invoke_finalizers();
#	ifndef THREADS
	  GC_ASSERT(GC_finalize_now == 0);
#	endif	/* Otherwise GC can run concurrently and add more */
	return;
   }
   if (GC_finalizer_notifier != (void (*) (void))0
	&& last_finalizer_notification != GC_gc_no) {
	last_finalizer_notification = GC_gc_no;
	GC_finalizer_notifier();
   }
}

調べるもの

参照元

コメント

コメントはありません。 コメント/Reading Gauche/Reading Gauche 0.9/gc/finalize.c/GC_notify_or_invoke_finalizers?

お名前:

MENU

now: 4

リンク


最新の20件
2020-03-23 2020-03-17 2019-12-22 2019-07-30 2019-06-20 2019-06-19 2019-03-24 2018-10-07 2018-09-20 2017-09-29 2017-01-10 2016-12-11 2016-10-04 2016-08-14
最新の20件
2010-02-01 2010-01-31 2010-01-30 2010-01-29 2010-01-16

Counter: 1151, today: 1, yesterday: 1

リロード   新規 編集 凍結 差分 添付 複製 改名   トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS

Last-modified: 2010-01-04 (月) 16:45:34 (3736d);  Modified by mona
PukiWiki 1.4.6 Copyright © 2001-2005 PukiWiki Developers Team. License is GPL.
Based on "PukiWiki" 1.3 by yu-ji
Powered by PHP 5.2.17
HTML convert time to 0.035 sec.