on master help sign in
Add INLINE pragma on Serialize instances
commit52ddfeed9cba21352c7a9c1a99568a6c59deb2cc authorHarendra Kumar <harendra@composewell.com> dateSat 12 Aug 2023, 04:52 (3 years ago) parent53aa204
1 file changed+3
core/src/Streamly/Internal/Data/Serialize.hs+3
core/src/Streamly/Internal/Data/Serialize.hs+3
@@ -102,11 +102,14 @@ class Serialize a where
102102
103103#define DERIVE_SERIALIZE_FROM_UNBOX(_type) \
104104instance Serialize _type where \
105+; {-# INLINE size #-} \
105106; size = ConstSize $ Unbox.sizeOf (Proxy :: Proxy _type) \
107+; {-# INLINE deserialize #-} \
106108; deserialize off arr = \
107109 Unbox.peekByteIndex off arr >>= \
108110 \val -> let sz = Unbox.sizeOf (Proxy :: Proxy _type) \
109111 in pure (off + sz, val) \
112+; {-# INLINE serialize #-} \
110113; serialize off arr val = \
111114 Unbox.pokeByteIndex off arr val \
112115 >> let sz = Unbox.sizeOf (Proxy :: Proxy _type) \