@@ -14,6 +14,7 @@ module Streamly.Memory.Ring
18 -- * Modification
19 -- * Modification
19 , unsafeInsert
20 , unsafeInsert
@@ -58,6 +59,10 @@ data Ring a = Ring
58 , ringBound :: {-# UNPACK #-} !(Ptr a) -- first address beyond allocated memory
59 , ringBound :: {-# UNPACK #-} !(Ptr a) -- first address beyond allocated memory
62+-- | Get the first address of the ring as a pointer.
63+startOf :: Ring a -> Ptr a
64+startOf = unsafeForeignPtrToPtr . ringStart
61-- | Create a new ringbuffer and return the ring buffer and the ringHead.
66-- | Create a new ringbuffer and return the ring buffer and the ringHead.
62-- Returns the ring and the ringHead, the ringHead is same as ringStart.
67-- Returns the ring and the ringHead, the ringHead is same as ringStart.
63{-# INLINE new #-}
68{-# INLINE new #-}