[Git][ghc/ghc][wip/ghc-9.6.7-backports] rts: don't export atomic_inc64
Luite Stegeman (@luite)
gitlab at gitlab.haskell.org
Fri Jan 31 13:57:53 UTC 2025
Luite Stegeman pushed to branch wip/ghc-9.6.7-backports at Glasgow Haskell Compiler / GHC
Commits:
6205e04a by Luite Stegeman at 2025-01-31T14:51:48+01:00
rts: don't export atomic_inc64
This makes it easier for packges to use GHC 9.6.7 because the
symbols exported by the rts are the same as in 9.6.6.
This means that we define the symbol in the ghc library
instead, where we have to pessimistically assume a threaded
rts.
- - - - -
3 changed files:
- compiler/cbits/genSym.c
- rts/RtsSymbols.c
- rts/include/stg/SMP.h
Changes:
=====================================
compiler/cbits/genSym.c
=====================================
@@ -30,8 +30,8 @@ HsInt ghc_unique_inc = 1;
// This function has been added to the RTS. Here we pessimistically assume
// that a threaded RTS is used. This function is only used for bootstrapping.
-#if !MIN_VERSION_GLASGOW_HASKELL(9,6,7,0)
-EXTERN_INLINE StgWord64
+#if !MIN_VERSION_GLASGOW_HASKELL(9,7,0,0)
+STATIC_INLINE StgWord64
atomic_inc64(StgWord64 volatile* p, StgWord64 incr)
{
#if defined(HAVE_C11_ATOMICS)
=====================================
rts/RtsSymbols.c
=====================================
@@ -923,7 +923,6 @@ extern char **environ;
SymI_HasProto(stopHeapProfTimer) \
SymI_HasProto(requestHeapCensus) \
SymI_HasProto(atomic_inc) \
- SymI_HasProto(atomic_inc64) \
SymI_HasProto(atomic_dec) \
SymI_HasProto(hs_spt_lookup) \
SymI_HasProto(hs_spt_insert) \
=====================================
rts/include/stg/SMP.h
=====================================
@@ -87,15 +87,6 @@ EXTERN_INLINE StgWord cas_seq_cst_relaxed(StgVolatilePtr p, StgWord o, StgWord n
EXTERN_INLINE StgWord atomic_inc(StgVolatilePtr p, StgWord n);
-/*
- * Atomic 64-bit addition of by the provided quantity
- *
- * atomic_inc64(p, n) {
- * return ((*p) += n);
- * }
- */
-EXTERN_INLINE StgWord64 atomic_inc64(StgWord64 volatile* p, StgWord64 n);
-
/*
* Atomic decrement
*
@@ -440,16 +431,6 @@ atomic_inc(StgVolatilePtr p, StgWord incr)
#endif
}
-EXTERN_INLINE StgWord64
-atomic_inc64(StgWord64 volatile* p, StgWord64 incr)
-{
-#if defined(HAVE_C11_ATOMICS)
- return __atomic_add_fetch(p, incr, __ATOMIC_SEQ_CST);
-#else
- return __sync_add_and_fetch(p, incr);
-#endif
-}
-
EXTERN_INLINE StgWord
atomic_dec(StgVolatilePtr p)
{
@@ -678,15 +659,6 @@ atomic_inc(StgVolatilePtr p, StgWord incr)
return ((*p) += incr);
}
-
-EXTERN_INLINE StgWord64 atomic_inc64(StgWord64 volatile* p, StgWord64 incr);
-EXTERN_INLINE StgWord64
-atomic_inc64(StgWord64 volatile* p, StgWord64 incr)
-{
- return ((*p) += incr);
-}
-
-
INLINE_HEADER StgWord
atomic_dec(StgVolatilePtr p)
{
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6205e04ae920776f282df9a428829d9e90a9c776
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6205e04ae920776f282df9a428829d9e90a9c776
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250131/8202e94d/attachment-0001.html>
More information about the ghc-commits
mailing list