summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2009-06-12 11:41:56 +0000
committerDuncan Coutts <duncan@well-typed.com>2009-06-12 11:41:56 +0000
commit85df606a23117641682e19f3851099134e5f77a4 (patch)
tree6eee4ab0b86a7ba96aece61bb16e1abc409a4e56 /rts/Linker.c
parentf5c113de54455bc1320da4674c70e17598832533 (diff)
downloadhaskell-85df606a23117641682e19f3851099134e5f77a4.tar.gz
Add and export rts_unsafeGetMyCapability from rts
We need this, or something equivalent, to be able to implement stgAllocForGMP outside of the rts. That's because we want to use allocateLocal which allocates from the given capability without having to take any locks. In the gmp primops we're basically in an unsafe foreign call, that is a context where we hold a current capability. So it's safe for us to use allocateLocal. We just need a way to get the current capability. The method to get the current capability varies depends on whether we're using the threaded rts or not. When stgAllocForGMP is built inside the rts that's ok because we can do it conditionally on THREADED_RTS. Outside the rts we need a single api we can call without knowing if we're talking to a threaded rts or not, hence this addition.
Diffstat (limited to 'rts/Linker.c')
-rw-r--r--rts/Linker.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 283103fdd2..68bd5864a1 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -752,6 +752,7 @@ typedef struct _RtsSymbolVal {
SymI_HasProto(rts_mkWord32) \
SymI_HasProto(rts_mkWord64) \
SymI_HasProto(rts_unlock) \
+ SymI_HasProto(rts_unsafeGetMyCapability) \
SymI_HasProto(rtsSupportsBoundThreads) \
SymI_HasProto(__hscore_get_saved_termios) \
SymI_HasProto(__hscore_set_saved_termios) \