2009-09-16 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Wed, 16 Sep 2009 08:59:10 +0000 (08:59 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:46 +0000 (21:06 +0400)
(ivmai126.diff)

* gcj_mlc.c (GC_gcj_fake_mark_proc): New static function.
* gcj_mlc.c (GC_init_gcj_malloc): If mp is 0 then supply
GC_gcj_fake_mark_proc (aborting with the appropriate message)
instead.

ChangeLog
gcj_mlc.c

index eb375f7..d2d9d89 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,12 @@
 2009-09-16  Ivan Maidanski <ivmai@mail.ru>
+       (ivmai126.diff)
+
+       * gcj_mlc.c (GC_gcj_fake_mark_proc): New static function.
+       * gcj_mlc.c (GC_init_gcj_malloc): If mp is 0 then supply
+       GC_gcj_fake_mark_proc (aborting with the appropriate message)
+       instead.
+
+2009-09-16  Ivan Maidanski <ivmai@mail.ru>
        (ivmai125.diff)
 
        * os_dep.c (GC_wince_get_mem): If VirtualAlloc() returns NULL (due
index b4b0f52..7a1a046 100644 (file)
--- a/gcj_mlc.c
+++ b/gcj_mlc.c
@@ -50,6 +50,16 @@ int GC_gcj_debug_kind;       /* The kind of objects that is always marked    */
 ptr_t * GC_gcjobjfreelist;
 ptr_t * GC_gcjdebugobjfreelist;
 
+/*ARGSUSED*/
+STATIC struct GC_ms_entry * GC_gcj_fake_mark_proc(word * addr,
+                                       struct GC_ms_entry *mark_stack_ptr,
+                                       struct GC_ms_entry *mark_stack_limit,
+                                       word env)
+{
+    ABORT("No client gcj mark proc is specified");
+    return mark_stack_ptr;
+}
+
 /* Caller does not hold allocation lock. */
 GC_API void GC_CALL GC_init_gcj_malloc(int mp_index,
                                void * /* really GC_mark_proc */mp)
@@ -57,6 +67,9 @@ GC_API void GC_CALL GC_init_gcj_malloc(int mp_index,
     GC_bool ignore_gcj_info;
     DCL_LOCK_STATE;
 
+    if (mp == 0)       /* In case GC_DS_PROC is unused.        */
+      mp = (void *)(word)GC_gcj_fake_mark_proc;
+
     GC_init(); /* In case it's not already done.       */
     LOCK();
     if (GC_gcj_malloc_initialized) {