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

Remove OpenSnapshot and CommittedSnapshot markers. #14

Merged

Commits on Nov 5, 2018

  1. Remove OpenSnapshot and CommittedSnapshot markers.

    They're not strictly necessary, and they result in the `Vec` being
    allocated even for the trivial (and common) case where a
    `start_snapshot` is immediately followed by a `commit` or `rollback_to`.
    
    This commit removes them, and instead uses a counter to track how many
    snapshots are open. One consequence of this is that violations of stack
    discipline in API usage may be detected later -- e.g. if we rollback to
    an earlier snapshot and then to a later snapshot, the code will panic on
    the second rollback instead of the first. I think this is an acceptable
    trade-off for the improved performance.
    
    This commit also adds some basic unit tests.
    nnethercote committed Nov 5, 2018
    Configuration menu
    Copy the full SHA
    2c162ce View commit details
    Browse the repository at this point in the history