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

expose unsafe methods to create and forget PushGuards #163

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Aug 28, 2017

This is most useful when poking at the Lua state directly.

The most important methods made public are new to create a new
PushGuard, and forget to not run this PushGuard's destructor.
They're both unsafe because their misuse can easily cause the Lua
stack to be out of sync with Rust PushGuards.

Also expose a size method to access the number of elements this
PushGuard is managing, and provide an internal-only safe version of
forget under the assumption that consumers within this crate know what
they're doing.

This is most useful when using a library to poke at the Rust state.

The most important methods made public are `new` to create a new
`PushGuard`, and `forget` to not run this `PushGuard`'s destructor.
They're both unsafe because their misuse can easily cause crashes.

Also expose a `size` method to access the number of elements this
`PushGuard` is managing, and provide an internal-only safe version of
`forget` under the assumption that consumers within this crate know what
they're doing.
@tomaka tomaka merged commit f2e0710 into tomaka:master Aug 29, 2017
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.

2 participants