summaryrefslogtreecommitdiff
path: root/rts/sm
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-08-05 10:21:59 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-08-05 10:21:59 +0000
commit7d7c187b4a12f1bb350e85cdb0115e19537cc704 (patch)
tree2bfcb2d4e6ebacce3e80dd8fa454452aa76c0049 /rts/sm
parentacdd7c95066cf6505a4d2e8683f119146805af91 (diff)
downloadhaskell-7d7c187b4a12f1bb350e85cdb0115e19537cc704.tar.gz
Declare RTS-private prototypes with __attribute__((visibility("hidden")))
This has no effect with static libraries, but when the RTS is in a shared library it does two things: - it prevents the function from being exposed by the shared library - internal calls to the function can use the faster non-PLT calls, because the function cannot be overriden at link time.
Diffstat (limited to 'rts/sm')
-rw-r--r--rts/sm/BlockAlloc.h12
-rw-r--r--rts/sm/Compact.h6
-rw-r--r--rts/sm/Evac.h4
-rw-r--r--rts/sm/GC.h4
-rw-r--r--rts/sm/GCThread.h4
-rw-r--r--rts/sm/GCUtils.h4
-rw-r--r--rts/sm/MarkWeak.h4
-rw-r--r--rts/sm/OSMem.h4
-rw-r--r--rts/sm/Scav.h4
-rw-r--r--rts/sm/Storage.h4
-rw-r--r--rts/sm/Sweep.h2
11 files changed, 46 insertions, 6 deletions
diff --git a/rts/sm/BlockAlloc.h b/rts/sm/BlockAlloc.h
index 776df9b627..86836e40b4 100644
--- a/rts/sm/BlockAlloc.h
+++ b/rts/sm/BlockAlloc.h
@@ -9,16 +9,20 @@
#ifndef BLOCK_ALLOC_H
#define BLOCK_ALLOC_H
+#pragma GCC visibility push(hidden)
+
/* Debugging -------------------------------------------------------------- */
#ifdef DEBUG
-extern void checkFreeListSanity(void);
-nat countFreeList(void);
-void markBlocks (bdescr *bd);
-void reportUnmarkedBlocks (void);
+void checkFreeListSanity(void);
+nat countFreeList(void);
+void markBlocks (bdescr *bd);
+void reportUnmarkedBlocks (void);
#endif
extern lnat n_alloc_blocks; // currently allocated blocks
extern lnat hw_alloc_blocks; // high-water allocated blocks
+#pragma GCC visibility pop
+
#endif /* BLOCK_ALLOC_H */
diff --git a/rts/sm/Compact.h b/rts/sm/Compact.h
index 7a237ac362..1e89ad36a8 100644
--- a/rts/sm/Compact.h
+++ b/rts/sm/Compact.h
@@ -14,6 +14,8 @@
#ifndef SM_COMPACT_H
#define SM_COMPACT_H
+#pragma GCC visibility push(hidden)
+
INLINE_HEADER rtsBool
mark_stack_empty(void)
{
@@ -74,6 +76,8 @@ is_marked(StgPtr p, bdescr *bd)
return (*bitmap_word & bit_mask);
}
-extern void compact (StgClosure *static_objects);
+void compact (StgClosure *static_objects);
+
+#pragma GCC visibility pop
#endif /* SM_COMPACT_H */
diff --git a/rts/sm/Evac.h b/rts/sm/Evac.h
index 78d024f3e9..ca5032f772 100644
--- a/rts/sm/Evac.h
+++ b/rts/sm/Evac.h
@@ -14,6 +14,8 @@
#ifndef SM_EVAC_H
#define SM_EVAC_H
+#pragma GCC visibility push(hidden)
+
// Use a register argument for evacuate, if available.
// Earlier, the regparm attribute was used whenever __GNUC__ >= 2, but this
// generated warnings on PPC. So the use is restricted further.
@@ -35,5 +37,7 @@ REGPARM1 void evacuate1 (StgClosure **p);
extern lnat thunk_selector_depth;
+#pragma GCC visibility pop
+
#endif /* SM_EVAC_H */
diff --git a/rts/sm/GC.h b/rts/sm/GC.h
index e746f092e5..2435c6cd4b 100644
--- a/rts/sm/GC.h
+++ b/rts/sm/GC.h
@@ -14,6 +14,8 @@
#ifndef SM_GC_H
#define SM_GC_H
+#pragma GCC visibility push(hidden)
+
void GarbageCollect(rtsBool force_major_gc, nat gc_type, Capability *cap);
typedef void (*evac_fn)(void *user, StgClosure **root);
@@ -56,4 +58,6 @@ void releaseGCThreads (Capability *cap);
#define WORK_UNIT_WORDS 128
+#pragma GCC visibility pop
+
#endif /* SM_GC_H */
diff --git a/rts/sm/GCThread.h b/rts/sm/GCThread.h
index 9188a20a9a..44ea537cda 100644
--- a/rts/sm/GCThread.h
+++ b/rts/sm/GCThread.h
@@ -16,6 +16,8 @@
#include "WSDeque.h"
+#pragma GCC visibility push(hidden)
+
/* -----------------------------------------------------------------------------
General scheme
@@ -270,5 +272,7 @@ extern StgWord8 the_gc_thread[];
#endif
+#pragma GCC visibility pop
+
#endif // SM_GCTHREAD_H
diff --git a/rts/sm/GCUtils.h b/rts/sm/GCUtils.h
index d68ce7876f..c8f8d55c60 100644
--- a/rts/sm/GCUtils.h
+++ b/rts/sm/GCUtils.h
@@ -14,6 +14,8 @@
#ifndef SM_GCUTILS_H
#define SM_GCUTILS_H
+#pragma GCC visibility push(hidden)
+
bdescr *allocBlock_sync(void);
void freeChain_sync(bdescr *bd);
@@ -59,4 +61,6 @@ recordMutableGen_GC (StgClosure *p, nat gen_no)
*bd->free++ = (StgWord)p;
}
+#pragma GCC visibility pop
+
#endif /* SM_GCUTILS_H */
diff --git a/rts/sm/MarkWeak.h b/rts/sm/MarkWeak.h
index 2647a22eec..7fd81e536b 100644
--- a/rts/sm/MarkWeak.h
+++ b/rts/sm/MarkWeak.h
@@ -14,6 +14,8 @@
#ifndef SM_MARKWEAK_H
#define SM_MARKWEAK_H
+#pragma GCC visibility push(hidden)
+
extern StgWeak *old_weak_ptr_list;
extern StgTSO *resurrected_threads;
extern StgTSO *exception_threads;
@@ -23,4 +25,6 @@ rtsBool traverseWeakPtrList ( void );
void markWeakPtrList ( void );
rtsBool traverseBlackholeQueue ( void );
+#pragma GCC visibility pop
+
#endif /* SM_MARKWEAK_H */
diff --git a/rts/sm/OSMem.h b/rts/sm/OSMem.h
index 3dbca23d11..92fe350045 100644
--- a/rts/sm/OSMem.h
+++ b/rts/sm/OSMem.h
@@ -9,10 +9,14 @@
#ifndef SM_OSMEM_H
#define SM_OSMEM_H
+#pragma GCC visibility push(hidden)
+
void osMemInit(void);
void *osGetMBlocks(nat n);
void osFreeAllMBlocks(void);
lnat getPageSize (void);
void setExecutable (void *p, lnat len, rtsBool exec);
+#pragma GCC visibility pop
+
#endif /* SM_OSMEM_H */
diff --git a/rts/sm/Scav.h b/rts/sm/Scav.h
index 10b9ffde40..259fe1289a 100644
--- a/rts/sm/Scav.h
+++ b/rts/sm/Scav.h
@@ -14,6 +14,8 @@
#ifndef SM_SCAV_H
#define SM_SCAV_H
+#pragma GCC visibility push(hidden)
+
void scavenge_loop (void);
void scavenge_mutable_list (bdescr *bd, generation *gen);
void scavenge_capability_mut_lists (Capability *cap);
@@ -24,5 +26,7 @@ void scavenge_mutable_list1 (bdescr *bd, generation *gen);
void scavenge_capability_mut_Lists1 (Capability *cap);
#endif
+#pragma GCC visibility pop
+
#endif /* SM_SCAV_H */
diff --git a/rts/sm/Storage.h b/rts/sm/Storage.h
index c6aa45e162..ea744a7a74 100644
--- a/rts/sm/Storage.h
+++ b/rts/sm/Storage.h
@@ -9,6 +9,8 @@
#ifndef SM_STORAGE_H
#define SM_STORAGE_H
+#pragma GCC visibility push(hidden)
+
/* -----------------------------------------------------------------------------
Initialisation / De-initialisation
-------------------------------------------------------------------------- */
@@ -166,4 +168,6 @@ void move_TSO (StgTSO *src, StgTSO *dest);
extern StgClosure * caf_list;
extern StgClosure * revertible_caf_list;
+#pragma GCC visibility pop
+
#endif /* SM_STORAGE_H */
diff --git a/rts/sm/Sweep.h b/rts/sm/Sweep.h
index 562a934faa..f540cb3509 100644
--- a/rts/sm/Sweep.h
+++ b/rts/sm/Sweep.h
@@ -14,6 +14,6 @@
#ifndef SM_SWEEP_H
#define SM_SWEEP_H
-void sweep(step *gen);
+RTS_PRIVATE void sweep(step *gen);
#endif /* SM_SWEEP_H */