Commit 228d4670 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

Use memcpy in cloneArray

While looking at #13615 I noticed that there was this strange open-coded
memcpy in the definition of the cloneArray macro. I don't see why this
should be preferable to memcpy.

Test Plan: Validate, particularly focusing on array operations

Reviewers: simonmar, tibbe, austin, alexbiehl

Reviewed By: tibbe, alexbiehl

Subscribers: alexbiehl, rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3504
parent b2c38d6b
......@@ -849,14 +849,7 @@
\
dst_p = dst + SIZEOF_StgMutArrPtrs; \
src_p = src + SIZEOF_StgMutArrPtrs + WDS(offset); \
while: \
if (n != 0) { \
n = n - 1; \
W_[dst_p] = W_[src_p]; \
dst_p = dst_p + WDS(1); \
src_p = src_p + WDS(1); \
goto while; \
} \
prim %memcpy(dst_p, src_p, n * SIZEOF_W, SIZEOF_W); \
\
return (dst);
......@@ -931,13 +924,6 @@
\
dst_p = dst + SIZEOF_StgSmallMutArrPtrs; \
src_p = src + SIZEOF_StgSmallMutArrPtrs + WDS(offset); \
while: \
if (n != 0) { \
n = n - 1; \
W_[dst_p] = W_[src_p]; \
dst_p = dst_p + WDS(1); \
src_p = src_p + WDS(1); \
goto while; \
} \
prim %memcpy(dst_p, src_p, n * SIZEOF_W, SIZEOF_W); \
\
return (dst);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment