コード例 #1
0
ファイル: alloc.c プロジェクト: MattTuttle/neko
void neko_gc_init() {
	GC_set_warn_proc((GC_warn_proc)(void*)null_warn_proc);
#	ifndef NEKO_WINDOWS
	// we can't set this on windows with old GC since
	// it's already initialized through its own DllMain
	GC_all_interior_pointers = 0;
#	endif
#if (GC_VERSION_MAJOR >= 7) && defined(NEKO_WINDOWS)
	GC_all_interior_pointers = 0;
#	ifndef NEKO_STANDALONE
	GC_use_DllMain(); // needed to auto-detect threads created by Apache
#	endif
#endif
	GC_java_finalization = 1;
	GC_init();
	GC_no_dls = 1;
#ifdef LOW_MEM
	GC_dont_expand = 1;
#endif
	GC_clear_roots();
#if defined(GC_LOG) && defined(NEKO_POSIX)
	{
		struct sigaction act;
		act.sa_sigaction = NULL;
		act.sa_handler = handle_signal;
		act.sa_flags = 0;
		sigemptyset(&act.sa_mask);
		sigaction(SIGSEGV,&act,NULL);
	}
#endif
}
コード例 #2
0
void scheme_set_stack_base(void *base, int no_auto_statics)
{
#if defined(MZ_PRECISE_GC) || defined(USE_SENORA_GC)
  GC_set_stack_base(base);
  /* no_auto_statics must always be true! */
#else
  GC_stackbottom = base;
  if (no_auto_statics) {
    GC_no_dls = 1;
    GC_init();
    GC_clear_roots();
  } else {
# if defined(__APPLE__) && defined(__MACH__)
    GC_init(); /* For Darwin, CGC requires GC_init() always */
# endif
  }
#endif
  use_registered_statics = no_auto_statics;
}