Skip to content

Refactor MPIPtr cconvert to support Julia 1.14#941

Open
nhz2 wants to merge 3 commits intoJuliaParallel:masterfrom
nhz2:nz/cconvert-refactor
Open

Refactor MPIPtr cconvert to support Julia 1.14#941
nhz2 wants to merge 3 commits intoJuliaParallel:masterfrom
nhz2:nz/cconvert-refactor

Conversation

@nhz2
Copy link
Copy Markdown

@nhz2 nhz2 commented Mar 28, 2026

Alternative to #935

CC @eschnett @giordano @vchuravy

@nhz2 nhz2 marked this pull request as ready for review March 28, 2026 20:00
@eschnett
Copy link
Copy Markdown
Contributor

One of the main features of ccall and its automatic conversion to pointers is that it's GC safe, i.e. that it holds on to the respective Julia objects while a pointer to the object is in use. I didn't follow the logic that you're introducing, but since this kind of error (losing a GC root) is very difficult to diagnose, I want to recommend to add respective comments to the code, stating which part of the machinery is holding on to objects, which functions are called before objects are converted to pointers, and which are called on pointers.

@nhz2
Copy link
Copy Markdown
Author

nhz2 commented Mar 29, 2026

I've added some comments using Claude Code

@eschnett
Copy link
Copy Markdown
Contributor

Thanks! The description sounds correct, and I like the ASCII art.

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