Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbox variable length structures #2417

Merged
merged 2 commits into from
Jul 25, 2023
Merged

Unbox variable length structures #2417

merged 2 commits into from
Jul 25, 2023

Conversation

adithyaov
Copy link
Member

No description provided.

Copy link
Member

@harendra-kumar harendra-kumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Document the APIs
  • Add INLINE

core/src/Streamly/Internal/Data/Serialize.hs Outdated Show resolved Hide resolved
core/src/Streamly/Internal/Data/Serialize.hs Show resolved Hide resolved
peekByteIndex off arr = do
len <- Unbox.peekByteIndex off arr :: IO Int
let off1 = off + Unbox.sizeOf (Proxy :: Proxy Int)
let peekList buf o 0 = pure (o, reverse buf)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future, for the cases when the order does not matter we can define an alternative instance that does not reverse. That can be done on a newtype wrapper over list.

@adithyaov adithyaov linked an issue Jul 17, 2023 that may be closed by this pull request
@adithyaov adithyaov merged commit afd848e into master Jul 25, 2023
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend the Unbox serialization to variable length structures
3 participants