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

kernel: change how ours GCs represent master pointers #4937

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fingolfin
Copy link
Member

So far, our master pointers are pointers to a pointer to the data portion of a bag. This patch changes them to instead point at the start of the bag.

Pointing inside the bag, as was done before, was am optimization for the common case where one wants to access the content of a bag. However, at least on x86 and ARM architectures, there is no difference in practice, because adding an offset of 16 (GASMAN) resp. 8 (Boehm, Julia) is essentially free for most machine code opcodes used to access the data.

So this should not introduce a drawback, but at the same time there is no real advantage to doing this.

BUT of course there is still a reason why i want to do this: I need this for experimental work on the Julia GC integration (in an attempt to resolve oscar-system/GAP.jl#817). But right now the result is crashing, in the Julia GC -- hence I adapted the other GCs to also use this mode, so I can test that everything is fine in GASMAN with this change. It is locally for me, but having it here as a PR gives a chance for more extensive CI tests to check it; also, the change is ABI breaking, so testing it on a "clean slate" is better than on my system.

tl;dr: this PR is not for merging but to allow me to experiment

@fingolfin fingolfin added do not merge PRs which are not yet ready to be merged (e.g. submitted for discussion, or test results) topic: kernel labels Jul 12, 2022
@fingolfin fingolfin force-pushed the mh/gc-change-mptr branch 4 times, most recently from e5a12fd to 9d58fcb Compare July 12, 2022 21:31
@ChrisJefferson
Copy link
Contributor

Just to say, I'm generally in support of this -- I don't think it will make things any worse for GAP, and I can understand how it will improve integration with other systems. Good luck!

@fingolfin fingolfin changed the title kernel: change how ours GCs represent master pointers (DO NOT MERGE) kernel: change how ours GCs represent master pointers Jul 14, 2022
@fingolfin fingolfin closed this Jul 14, 2022
@fingolfin fingolfin reopened this Jul 14, 2022
@fingolfin fingolfin marked this pull request as ready for review July 14, 2022 14:53
@fingolfin fingolfin added release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes and removed do not merge PRs which are not yet ready to be merged (e.g. submitted for discussion, or test results) labels Jul 14, 2022
@fingolfin fingolfin force-pushed the mh/gc-change-mptr branch 2 times, most recently from 9d968fd to 77a8694 Compare July 21, 2022 22:31
So far, our master pointers are pointers to a pointer to the
data portion of a bag. This patch changes them to instead
point at the start of the bag.

Pointing inside the bag, as was done before, was am
optimization for the common case where one wants to access
the content of a bag. However, at least on x86 and ARM
architectures, there is no difference in practice, because
adding an offset of 16 (GASMAN) resp. 8 (Boehm, Julia) is
essentially free for most machine code opcodes used to
access the data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate replacing the foreign type GAP_jll.GapObj by struct GapObj x::Any end
2 participants