Visitar URL original
Optional checks to make 'poke' safer · Issue #55 · mgsloan/store · GitHub
Skip to content

Optional checks to make 'poke' safer #55

Open

Description

@mgsloan

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions