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

Replace no_refs option with unsafe_ref_capture option #6

Closed
wants to merge 1 commit into from

Conversation

haarg
Copy link
Contributor

@haarg haarg commented Oct 31, 2014

Capturing refs causes too many options that can't be worked around
fully. If used in an exception object, one of this module's most common
use cases, capturing objects will keep them alive for as long as the
exception object is alive. This can cause issues with objects that
expect to be DESTROYed at a certain time. Additionally, if thrown
inside a DESTROY sub, the exception object will keep the object being
destroyed alive until after the DESTROY sub finishes. The exception
object will then be freed, and the DESTROY on the object will be called
again.

There is no reliable way to work around those issues, switch to not
capturing by default. Rename the option controlling this from no_refs
to unsafe_ref_capture, but require it to be set true to capture refs.
The previous option will still work if set.

Capturing refs causes too many options that can't be worked around
fully.  If used in an exception object, one of this module's most common
use cases, capturing objects will keep them alive for as long as the
exception object is alive.  This can cause issues with objects that
expect to be DESTROYed at a certain time.  Additionally, if thrown
inside a DESTROY sub, the exception object will keep the object being
destroyed alive until after the DESTROY sub finishes.  The exception
object will then be freed, and the DESTROY on the object will be called
again.

There is no reliable way to work around those issues, switch to not
capturing by default.  Rename the option controlling this from no_refs
to unsafe_ref_capture, but require it to be set true to capture refs.
The previous option will still work if set.
@autarch
Copy link
Member

autarch commented Nov 1, 2014

Thanks, I merged this with a few text tweaks from the CLI.

@autarch autarch closed this Nov 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants