diff options
Diffstat (limited to 'rts')
-rw-r--r-- | rts/PrimOps.cmm | 14 | ||||
-rw-r--r-- | rts/RtsSymbols.c | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index b43dfbf554..bcf7b62fb7 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -151,6 +151,20 @@ stg_newAlignedPinnedByteArrayzh ( W_ n, W_ alignment ) return (p); } +stg_compareByteArrayszh ( gcptr src1, W_ src1_ofs, gcptr src2, W_ src2_ofs, W_ size ) +// ByteArray# -> Int# -> ByteArray# -> Int# -> Int# -> Int# +{ + CInt res; + W_ src1p, src2p; + + src1p = src1 + SIZEOF_StgHeader + OFFSET_StgArrBytes_payload + src1_ofs; + src2p = src2 + SIZEOF_StgHeader + OFFSET_StgArrBytes_payload + src2_ofs; + + (res) = ccall memcmp(src1p "ptr", src2p "ptr", size); + + return (TO_W_(res)); +} + stg_isByteArrayPinnedzh ( gcptr ba ) // ByteArray# s -> Int# { diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c index a696f44476..1ac143be95 100644 --- a/rts/RtsSymbols.c +++ b/rts/RtsSymbols.c @@ -674,6 +674,7 @@ SymI_HasProto(stg_casMutVarzh) \ SymI_HasProto(stg_newPinnedByteArrayzh) \ SymI_HasProto(stg_newAlignedPinnedByteArrayzh) \ + SymI_HasProto(stg_compareByteArrayszh) \ SymI_HasProto(stg_isByteArrayPinnedzh) \ SymI_HasProto(stg_isMutableByteArrayPinnedzh) \ SymI_HasProto(stg_shrinkMutableByteArrayzh) \ |