2009-09-16 Ivan Maidanski <ivmai@mail.ru>
+ (ivmai134.diff)
+
+ * alloc.c (GC_expand_hp): Replace GC_init_inner() call with
+ GC_init() one.
+ * malloc.c (GC_alloc_large, GC_generic_malloc_inner): Ditto.
+ * mallocx.c (GC_generic_malloc_many): Ditto.
+ * misc.c (GC_enable_incremental): Ditto.
+ * alloc.c (GC_expand_hp): Update the comment.
+ * mark.c (GC_obj_kinds): Ditto.
+ * win32_threads.c (GC_allow_register_threads): Ditto.
+ * private/gc_priv.h (GC_init_inner): Remove function declaration.
+ * misc.c (GC_init_inner): Replace with public GC_init().
+
+2009-09-16 Ivan Maidanski <ivmai@mail.ru>
(ivmai126.diff)
* gcj_mlc.c (GC_gcj_fake_mark_proc): New static function.
}
/* Really returns a bool, but it's externally visible, so that's clumsy. */
-/* Arguments is in bytes. */
+/* Arguments is in bytes. Includes GC_init() call. */
GC_API int GC_CALL GC_expand_hp(size_t bytes)
{
int result;
DCL_LOCK_STATE;
LOCK();
- if (!GC_is_initialized) GC_init_inner();
+ if (!GC_is_initialized) GC_init();
result = (int)GC_expand_hp_inner(divHBLKSZ((word)bytes));
if (result) GC_requested_heapsize += bytes;
UNLOCK();
/* as invalid. */
/* Misc GC: */
-void GC_init_inner(void);
GC_bool GC_expand_hp_inner(word n);
void GC_start_reclaim(int abort_if_found);
/* Restore unmarked objects to free */
/* Round up to a multiple of a granule. */
lb = (lb + GRANULE_BYTES - 1) & ~(GRANULE_BYTES - 1);
n_blocks = OBJ_SZ_TO_BLOCKS(lb);
- if (!GC_is_initialized) GC_init_inner();
+ if (!GC_is_initialized) GC_init();
/* Do our share of marking work */
if(GC_incremental && !GC_dont_gc)
GC_collect_a_little_inner((int)n_blocks);
if( (op = *opp) == 0 ) {
if (GC_size_map[lb] == 0) {
- if (!GC_is_initialized) GC_init_inner();
+ if (!GC_is_initialized) GC_init();
if (GC_size_map[lb] == 0) GC_extend_size_map(lb);
return(GC_generic_malloc_inner(lb, k));
}
if (GC_have_errors) GC_print_all_errors();
GC_INVOKE_FINALIZERS();
LOCK();
- if (!GC_is_initialized) GC_init_inner();
+ if (!GC_is_initialized) GC_init();
/* Do our share of marking work */
if (GC_incremental && !GC_dont_gc) {
ENTER_GC();
/* PTRFREE */ { &GC_aobjfreelist[0], 0 /* filled in dynamically */,
0 | GC_DS_LENGTH, FALSE, FALSE },
/* NORMAL */ { &GC_objfreelist[0], 0,
- 0 | GC_DS_LENGTH, /* Adjusted in GC_init_inner for EXTRA_BYTES */
+ 0 | GC_DS_LENGTH, /* Adjusted in GC_init for EXTRA_BYTES */
TRUE /* add length to descr */, TRUE },
/* UNCOLLECTABLE */
{ &GC_uobjfreelist[0], 0,
extern void GC_init_parallel(void);
# endif /* PARALLEL_MARK || THREAD_LOCAL_ALLOC */
-/* FIXME: The GC_init/GC_init_inner distinction should go away. */
-GC_API void GC_CALL GC_init(void)
-{
- /* LOCK(); -- no longer does anything this early. */
- GC_init_inner();
- /* UNLOCK(); */
-}
-
#if (defined(MSWIN32) || defined(MSWINCE)) && defined(THREADS)
CRITICAL_SECTION GC_write_cs;
#endif
extern int GC_unmap_threshold;
#endif
-void GC_init_inner(void)
+GC_API void GC_CALL GC_init(void)
{
+ /* LOCK(); -- no longer does anything this early. */
# if !defined(THREADS) && defined(GC_ASSERTIONS)
word dummy;
# endif
maybe_install_looping_handler(); /* Before write fault handler! */
GC_incremental = TRUE;
if (!GC_is_initialized) {
- GC_init_inner();
+ GC_init();
} else {
GC_dirty_init();
}
GC_ASSERT(GC_lookup_thread_inner(GetCurrentThreadId()) != 0);
# if !defined(GC_NO_DLLMAIN) && !defined(PARALLEL_MARK)
- /* GC_init_parallel() is not called from GC_init_inner(). */
+ /* GC_init() doesn't call GC_init_parallel() in this case. */
parallel_initialized = TRUE;
# endif
GC_need_to_lock = TRUE; /* We are multi-threaded now. */