summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDaniel Peebles <pumpkingod@gmail.com>2011-04-12 13:35:59 +0200
committerSimon Marlow <marlowsd@gmail.com>2011-05-19 14:04:26 +0100
commita6cc4146630e34f2d69c5a0358a9133420f9102c (patch)
tree7f090330baa6cfc17067a504784052419783be4d /includes
parent7c185cd2525a20dcfa9859c5e6cf2f6300a19cc1 (diff)
downloadhaskell-a6cc4146630e34f2d69c5a0358a9133420f9102c.tar.gz
Add array copy/clone primops
Diffstat (limited to 'includes')
-rw-r--r--includes/Cmm.h6
-rw-r--r--includes/stg/MiscClosures.h6
2 files changed, 10 insertions, 2 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h
index 0ba14fbff6..641faa216e 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -464,8 +464,10 @@
#define StgFunInfoExtra_bitmap(i) StgFunInfoExtraFwd_bitmap(i)
#endif
-#define mutArrPtrsCardWords(n) \
- ROUNDUP_BYTES_TO_WDS(((n) + (1 << MUT_ARR_PTRS_CARD_BITS) - 1) >> MUT_ARR_PTRS_CARD_BITS)
+#define mutArrCardMask ((1 << MUT_ARR_PTRS_CARD_BITS) - 1)
+#define mutArrPtrCardDown(i) ((i) >> MUT_ARR_PTRS_CARD_BITS)
+#define mutArrPtrCardUp(i) (((i) + mutArrCardMask) >> MUT_ARR_PTRS_CARD_BITS)
+#define mutArrPtrsCardWords(n) ROUNDUP_BYTES_TO_WDS(mutArrPtrCardUp(n))
#if defined(PROFILING) || (!defined(THREADED_RTS) && defined(DEBUG))
#define OVERWRITING_CLOSURE(c) foreign "C" overwritingClosure(c "ptr")
diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h
index ed0bf655e1..3851f08d19 100644
--- a/includes/stg/MiscClosures.h
+++ b/includes/stg/MiscClosures.h
@@ -380,6 +380,12 @@ RTS_FUN_DECL(stg_newByteArrayzh);
RTS_FUN_DECL(stg_newPinnedByteArrayzh);
RTS_FUN_DECL(stg_newAlignedPinnedByteArrayzh);
RTS_FUN_DECL(stg_newArrayzh);
+RTS_FUN_DECL(stg_copyArrayzh);
+RTS_FUN_DECL(stg_copyMutableArrayzh);
+RTS_FUN_DECL(stg_cloneArrayzh);
+RTS_FUN_DECL(stg_cloneMutableArrayzh);
+RTS_FUN_DECL(stg_freezzeArrayzh);
+RTS_FUN_DECL(stg_thawArrayzh);
RTS_FUN_DECL(stg_newMutVarzh);
RTS_FUN_DECL(stg_atomicModifyMutVarzh);