Repository navigation
Replies: 7 comments 7 replies
|
Lukas Fürmetz ***@***.***> writes:
Hi, I have a working setup (with a couple of patches) with the igc
branch from upstream. Are you interested in publishing that?
Interesting! Is it based on (the igc/emacs-mac part of)
https://github.com/gerd-moellmann/emacs-with-cl-packages?
|
1 reply
|
Yes, we are potentially interested. How substantial are the patches? Would of course be preferable to upstream any patches to files in common with NS. |
1 reply
|
I pushed the changes here: https://github.com/akermu/emacs-mac/tree/emacs-mac-gnu_master_exp_igc. One open topic is, that currently the |
0 replies
|
Lukas Fürmetz ***@***.***> writes:
I pushed the changes here:
https://github.com/akermu/emacs-mac/tree/emacs-mac-gnu_master_exp_igc.
One open topic is, that currently the igc_root for the window is not
destroyed, so it will leak memory for every window, but other than
that it works for me without crashing.
I've taken a quick look, and I think what you did is quite different
from what I did in my fork. I think you are using roots in a few places,
where I went the way I also took for ns, which is to avoid roots where
possible, especially ambiguous roots. TBH, I wouldn't recommend using
roots, sorry.
Anyway, I think you have a working version of feature/igc + mac when not
using MPS. That would be a good basis for someone to port what I have to
mac/master.
I've not done that because it's simply too much work for me. It would
basically mean a port similar or even more work than the original port
of my igc to GNU in 2024. FWIW, there is also this other discussion
where I announced mac+igc.
#68
|
1 reply
|
Lukas Fürmetz ***@***.***> writes:
Can you go into a little more detail, why not using roots? As far as I
have seen, the roots are also used for other display systems.
Yes, sometimes there is no way around it, and sometimes it is simply
convenient. (I know only the ns side, since I'm using macOS only.)
We, including Helmut and Pip, try to avoid roots because all roots must
be scanned before anything can be collected. This is so because roots
don't have memory barriers on them which would allow some form of
incremental updating. That in turn means the more roots the more to scan
and that's increasing the time of an incremental GC step.
Ambiguous roots are less desirable than exact roots because they prevent
copying objects. That means that memory segments containing ambiguously
referenced objects can only partially emptied and not be reused for new
objects until that ambigous reference no longer exists. if you make
something an ambig root that contains a struct frame *, for example,
that pins the frame object and so on.
The alternative is to change pointers to Lisp objects contained in GUI
structures with pointers to pointers (analogously with "obfuscated"
pointers, i.e. Lisp_Object). Then scan the GUI structures and when an
object's address changes, update the pointer. It's not that much work,
BTW.
Anyway, I think you have a working version of feature/igc + mac when not
using MPS. That would be a good basis for someone to port what I have to
mac/master.
This patched version works and runs igc, since the igc-stats is
filled. I guess I'm missing something here, so can you please explain
what?
I don't doubt it works, at least for some time :-). Question is if you
got all places in the GUI code that use some Lisp object (frame, window,
buffer, ...) that can change its address when MPS is used.
Please don't get me wrong, I have no money in the game, so to speak.
If what you have works for you, it's fine with me. I'm just saying.
|
1 reply
|
I think it's worth pushing on these branches to get them streamlined and tested. If IGC lands upstream, that work will be very valuable. Doesn't seem like it's on track for v31 atm, but who knows. |
3 replies
|
Lukas Fürmetz ***@***.***> writes:
Thanks for the in-depth explanation, that cleared up a lot of things
for me! In your alternative proposal, would it be enough to wrap those
in a Lisp_Object and allocate them in the mps arena? And when would
this scan happen, exactly? Because the scan needs to be triggered from
a gc run, doesn't it?
One important thing to keep in mind is that Lisp_Object is just a
pointer in disguise, i.e. it is a pointer with some tag bits (ignoring
fixnums and so on). Igc can handle both "raw" pointers and tagged ones,
i.e. Lisp_Objects. Or, looked from another direction, changing a pointer
to a Lisp_Object or vice versa doesn't change the situation much.
What I've done for ns and mac is to introduce additional indirections.
Sorry, I don't remember every detail anymore, but something containing a
member say "struct frame *emacsframe" becomes "struct frame
**emacsframe", and we allocate "emacsframe" as an exact root via one of
the igc allocation functions. That means the code that used to use
emacsframe directly has to use "*emacsframe" now.
Using roots for this is unfortunate, but at least they are exact, so
objects can be copied, and the root is small with 1 word. And since some
stuff is allocated by Cocoa, there is not much else one can do, I guess.
At least I didn't find something which would allow me to allocate at
least some Cocoa objects from MPS.
P.S.:
I think (not sure of course) one could more or less just copy the mac
files from my cl-packages branch for a mac/igc branch that is based on
feature/igc. I don't think I have many changes in there compared to
mac/master, except the ability to run src/emacs like one can with ns.
That would leave emacs.c and igc.[ch] where copying is probably not
enough. I have other changes in igc.[ch] that are caused, among other
stuff probably, by my different markers, symbols, packages, having no
obarrays and other stuff, compared to feature/igc. The main thing one
wants is the different initialization of igc in the mac case which is
caused by having a gui and a lisp thread. I guess one could find that
relatively easy by diffing with feature/igc.
That's at least what I'd try, I think. Still quite some work, of course.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, I have a working setup (with a couple of patches) with the
igcbranch from upstream. Are you interested in publishing that?All reactions