Skip to content

use getptr a lot less #618

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

use getptr a lot less #618

wants to merge 1 commit into from

Conversation

cjdoris
Copy link
Collaborator

@cjdoris cjdoris commented May 28, 2025

Defines an unsafe_convert rule for Py to C.PyPtr so we can pass Py directly to C functions.

Also defines incref(::Py) so we don't have to operate on pointers.

Generalises our faked C functions in extras.jl to also allow ::Py arguments in place of ::PyPtr.

Fixes #617 - and more generally removes a lot of places where the Julia GC could have freed a Py while we still have a pointer to the Python object, causing a read-after-free error.

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.

Segmentation fault when calling basic python functions
1 participant