gap icon indicating copy to clipboard operation
gap copied to clipboard

kernel: change how ours GCs represent master pointers

Open fingolfin opened this issue 2 years ago • 1 comments

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 https://github.com/oscar-system/GAP.jl/issues/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 avatar Jul 12 '22 14:07 fingolfin

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!

ChrisJefferson avatar Jul 13 '22 07:07 ChrisJefferson