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

Optional checks to make 'poke' safer #55

Open
mgsloan opened this issue Jun 13, 2016 · 0 comments
Open

Optional checks to make 'poke' safer #55

mgsloan opened this issue Jun 13, 2016 · 0 comments

Comments

@mgsloan
Copy link
Owner

mgsloan commented Jun 13, 2016

As documented on the size method, if size reports a different byte size than is actually used by poke, memory corruption, segfaults, and/or PokeExceptions may occur. This is freaky! It's done in the name of performance, in order to avoid checking it all the time.

One approach to this is to provide a lot of ways to safely define Store instances. The good news is that current store is pretty good for this. You just need to:

  1. Use the well-tested instanced provided by the library

  2. Use Generics / TH for deriving instances for your data types

  3. Use the testing utilities on any of your custom instances (and perhaps the derived ones too)

The need for (3) could potentially be reduced by implementing #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant