]> granicus.if.org Git - gc/commitdiff
Fix visibility of some GC internal symbols used by GCJ
authorIvan Maidanski <ivmai@mail.ru>
Sun, 25 Mar 2012 06:32:05 +0000 (10:32 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 25 Mar 2012 07:39:15 +0000 (11:39 +0400)
(Includes reverting part of commits 68b9f2791d5df5b2345fb)

* allchblk.c (GC_hblkfreelist, GC_free_bytes): Do not define array as
STATIC again but only if GC_GCJ_SUPPORT (for GNU GCJ client).
* blacklst.c (GC_is_black_listed): Do not define as GC_INNER again
(for GNU GCJ client).
* include/private/gc_priv.h (GC_is_black_listed): Likewise.
* include/private/gc_priv.h (GC_hblkfreelist): Restore removed
declaration (but only if GC_GCJ_SUPPORT).
* reclaim.c (GC_n_set_marks): Do not define as STATIC again (for GCJ);
update the comment.

allchblk.c
blacklst.c
include/private/gc_priv.h
reclaim.c

index bb08e79c84d611dfa59d6a6ace34f5eea1e511ff..4a13de4ad452a1436d20fc2882213889e2ef7fc1 100644 (file)
 # define N_HBLK_FLS ((HUGE_THRESHOLD - UNIQUE_THRESHOLD) / FL_COMPRESSION \
                      + UNIQUE_THRESHOLD)
 
-STATIC struct hblk * GC_hblkfreelist[N_HBLK_FLS+1] = { 0 };
+#ifndef GC_GCJ_SUPPORT
+  STATIC
+#endif
+  struct hblk * GC_hblkfreelist[N_HBLK_FLS+1] = { 0 };
                                 /* List of completely empty heap blocks */
                                 /* Linked through hb_next field of      */
                                 /* header structure associated with     */
-                                /* block.                               */
+                                /* block.  Remains externally visible   */
+                                /* as used by GNU GCJ currently.        */
 
-STATIC word GC_free_bytes[N_HBLK_FLS+1] = { 0 };
-        /* Number of free bytes on each list.   */
+#ifndef GC_GCJ_SUPPORT
+  STATIC
+#endif
+  word GC_free_bytes[N_HBLK_FLS+1] = { 0 };
+        /* Number of free bytes on each list.  Remains visible to GCJ.  */
 
 /* Return the largest n such that the number of free bytes on lists     */
 /* n .. N_HBLK_FLS is greater or equal to GC_max_large_allocd_bytes     */
index 626a95fdf4c6574c5b984e3989c42a7cd37d3932..0213176ffb8408f59dd8baffdd4466041d3be026 100644 (file)
@@ -225,7 +225,7 @@ GC_INNER void GC_unpromote_black_lists(void)
  * If (h,len) is not black listed, return 0.
  * Knows about the structure of the black list hash tables.
  */
-GC_INNER struct hblk * GC_is_black_listed(struct hblk *h, word len)
+struct hblk * GC_is_black_listed(struct hblk *h, word len)
 {
     word index = PHT_HASH((word)h);
     word i;
index 7749f0ac3e28df71345eeffe6c5c55ccb91bb046..bff14622627a330e2057ed8222a7c2e14e53509a 100644 (file)
@@ -1359,6 +1359,11 @@ GC_EXTERN word GC_black_list_spacing;
                         /* "stack-blacklisted", i.e. that are           */
                         /* problematic in the interior of an object.    */
 
+#ifdef GC_GCJ_SUPPORT
+  extern struct hblk * GC_hblkfreelist[];
+                                        /* Remains visible to GNU GCJ. */
+#endif
+
 #ifdef GC_DISABLE_INCREMENTAL
 # define GC_incremental FALSE
                         /* Hopefully allow optimizer to remove some code. */
@@ -1643,12 +1648,14 @@ void GC_register_data_segments(void);
             GC_add_to_black_list_stack((word)(bits))
 #endif /* PRINT_BLACK_LIST */
 
-GC_INNER struct hblk * GC_is_black_listed(struct hblk * h, word len);
+struct hblk * GC_is_black_listed(struct hblk * h, word len);
                         /* If there are likely to be false references   */
                         /* to a block starting at h of the indicated    */
                         /* length, then return the next plausible       */
                         /* starting location for h that might avoid     */
-                        /* these false references.                      */
+                        /* these false references.  Remains externally  */
+                        /* visible as used by GNU GCJ currently.        */
+
 GC_INNER void GC_promote_black_lists(void);
                         /* Declare an end to a black listing phase.     */
 GC_INNER void GC_unpromote_black_lists(void);
index 074bd4397fa14b611448dedb36e9bc3e874fee49..fd23836470ea5602d1e71f6bf486ed9e874f4296 100644 (file)
--- a/reclaim.c
+++ b/reclaim.c
@@ -467,8 +467,9 @@ struct Print_stats
 
 #ifdef USE_MARK_BYTES
 
-/* Return the number of set mark bits in the given header       */
-STATIC int GC_n_set_marks(hdr *hhdr)
+/* Return the number of set mark bits in the given header.      */
+/* Remains externally visible as used by GNU GCJ currently.     */
+int GC_n_set_marks(hdr *hhdr)
 {
     int result = 0;
     int i;
@@ -498,8 +499,7 @@ static int set_bits(word n)
     return(result);
 }
 
-/* Return the number of set mark bits in the given header       */
-STATIC int GC_n_set_marks(hdr *hhdr)
+int GC_n_set_marks(hdr *hhdr)
 {
     int result = 0;
     int i;