[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/gc/misc.c [Boehm-GC]
From: |
Dave Love |
Subject: |
[Emacs-diffs] Changes to emacs/gc/misc.c [Boehm-GC] |
Date: |
Mon, 16 Jun 2003 11:41:53 -0400 |
Index: emacs/gc/misc.c
diff -c emacs/gc/misc.c:1.2.2.1 emacs/gc/misc.c:1.2.2.2
*** emacs/gc/misc.c:1.2.2.1 Thu Jun 5 14:23:04 2003
--- emacs/gc/misc.c Mon Jun 16 11:41:51 2003
***************
*** 49,55 ****
# if defined(GC_WIN32_THREADS)
# if defined(GC_PTHREADS)
pthread_mutex_t GC_allocate_ml = PTHREAD_MUTEX_INITIALIZER;
! # elif !defined(GC_NOT_DLL) && (defined(_DLL) || defined(GC_DLL))
__declspec(dllexport) CRITICAL_SECTION GC_allocate_ml;
# else
CRITICAL_SECTION GC_allocate_ml;
--- 49,55 ----
# if defined(GC_WIN32_THREADS)
# if defined(GC_PTHREADS)
pthread_mutex_t GC_allocate_ml = PTHREAD_MUTEX_INITIALIZER;
! # elif defined(GC_DLL)
__declspec(dllexport) CRITICAL_SECTION GC_allocate_ml;
# else
CRITICAL_SECTION GC_allocate_ml;
***************
*** 487,492 ****
--- 487,501 ----
GC_init_parallel();
}
# endif /* PARALLEL_MARK || THREAD_LOCAL_ALLOC */
+
+ # if defined(DYNAMIC_LOADING) && defined(DARWIN)
+ {
+ /* This must be called WITHOUT the allocation lock held
+ and before any threads are created */
+ extern void GC_init_dyld();
+ GC_init_dyld();
+ }
+ # endif
}
#if defined(MSWIN32) || defined(MSWINCE)
***************
*** 499,504 ****
--- 508,529 ----
extern void GC_setpagesize();
+
+ #ifdef MSWIN32
+ extern GC_bool GC_no_win32_dlls;
+ #else
+ # define GC_no_win32_dlls FALSE
+ #endif
+
+ void GC_exit_check GC_PROTO((void))
+ {
+ GC_gcollect();
+ }
+
+ #ifdef SEARCH_FOR_DATA_START
+ extern void GC_init_linux_data_start GC_PROTO((void));
+ #endif
+
#ifdef UNIX_LIKE
extern void GC_set_and_save_fault_handler GC_PROTO((void (*handler)(int)));
***************
*** 509,529 ****
GC_err_printf1("Caught signal %d: looping in handler\n", sig);
for(;;);
}
- #endif
! #ifdef MSWIN32
! extern GC_bool GC_no_win32_dlls;
! #else
! # define GC_no_win32_dlls FALSE
! #endif
! void GC_exit_check GC_PROTO((void))
{
! GC_gcollect();
}
! #ifdef SEARCH_FOR_DATA_START
! extern void GC_init_linux_data_start GC_PROTO((void));
#endif
void GC_init_inner()
--- 534,556 ----
GC_err_printf1("Caught signal %d: looping in handler\n", sig);
for(;;);
}
! static GC_bool installed_looping_handler = FALSE;
! void maybe_install_looping_handler()
{
! /* Install looping handler before the write fault handler, so we */
! /* handle write faults correctly. */
! if (!installed_looping_handler && 0 != GETENV("GC_LOOP_ON_ABORT")) {
! GC_set_and_save_fault_handler(looping_handler);
! installed_looping_handler = TRUE;
! }
}
! #else /* !UNIX_LIKE */
!
! # define maybe_install_looping_handler()
!
#endif
void GC_init_inner()
***************
*** 590,600 ****
}
}
}
! # ifdef UNIX_LIKE
! if (0 != GETENV("GC_LOOP_ON_ABORT")) {
! GC_set_and_save_fault_handler(looping_handler);
! }
! # endif
/* Adjust normal object descriptor for extra allocation. */
if (ALIGNMENT > GC_DS_TAGS && EXTRA_BYTES != 0) {
GC_obj_kinds[NORMAL].ok_descriptor = ((word)(-ALIGNMENT) |
GC_DS_LENGTH);
--- 617,623 ----
}
}
}
! maybe_install_looping_handler();
/* Adjust normal object descriptor for extra allocation. */
if (ALIGNMENT > GC_DS_TAGS && EXTRA_BYTES != 0) {
GC_obj_kinds[NORMAL].ok_descriptor = ((word)(-ALIGNMENT) |
GC_DS_LENGTH);
***************
*** 641,649 ****
# endif
}
# endif
! GC_ASSERT(sizeof (ptr_t) == sizeof(word));
! GC_ASSERT(sizeof (signed_word) == sizeof(word));
! GC_ASSERT(sizeof (struct hblk) == HBLKSIZE);
# ifndef THREADS
# if defined(STACK_GROWS_UP) && defined(STACK_GROWS_DOWN)
ABORT(
--- 664,672 ----
# endif
}
# endif
! GC_STATIC_ASSERT(sizeof (ptr_t) == sizeof(word));
! GC_STATIC_ASSERT(sizeof (signed_word) == sizeof(word));
! GC_STATIC_ASSERT(sizeof (struct hblk) == HBLKSIZE);
# ifndef THREADS
# if defined(STACK_GROWS_UP) && defined(STACK_GROWS_DOWN)
ABORT(
***************
*** 765,772 ****
if (GC_incremental) goto out;
GC_setpagesize();
if (GC_no_win32_dlls) goto out;
! # ifndef GC_SOLARIS_THREADS
! GC_dirty_init();
# endif
if (!GC_is_initialized) {
GC_init_inner();
--- 788,796 ----
if (GC_incremental) goto out;
GC_setpagesize();
if (GC_no_win32_dlls) goto out;
! # ifndef GC_SOLARIS_THREADS
! maybe_install_looping_handler(); /* Before write fault handler! */
! GC_dirty_init();
# endif
if (!GC_is_initialized) {
GC_init_inner();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/gc/misc.c [Boehm-GC],
Dave Love <=