-
Notifications
You must be signed in to change notification settings - Fork 21
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
Investigate replacing the foreign type GAP_jll.GapObj
by struct GapObj x::Any end
#817
Comments
I experimented with this, and found a first major hitch: I tried to do mutable struct GapObj
x::Any
end but that doesn't work, because the pointer in a GAP master pointer does not actually point at the object, it points inside the object... I see potential ways to deal with that:
mutable struct GapObj
bag::Ptr{Cvoid} # points inside the content bag
realBag::Any # the actual content bag, for the Julia GC
end This way, code in the GAP C kernel which wants to access the content by double-dereferencing a bag pointer still can do it, while Julia can properly track the object relationships.
Approach 2 would be my preferred one. I'll experiment more |
I tried approach 2 back in July and got further, but then run into more crashes I couldn't figure out. Shelved it back then (but should have opened at least a PR with the code I had so far... sigh). Anyway, today while debugging some other code, it hit me: we have a I'll try if that helps ASAP, but didn't want to forget about it, hence this comment. |
This may be able to avoid oscar-system/Oscar.jl#1400 and JuliaLang/PackageCompiler.jl#700
But I am not sure whether it (a) is possible at all, and (b) will resolve the issue. Of course if it was possible, that'd be nice in any case....
To test this theory, I need to
GAP_InitJuliaMemoryInterface
already contains a globalGapObj
which is a struct type, and if so, use thatThe text was updated successfully, but these errors were encountered: