GNU bug report logs - #41242
Port feature/native-comp to Windows

Previous Next

Package: emacs;

Reported by: Nicolas Bértolo <nicolasbertolo <at> gmail.com>

Date: Wed, 13 May 2020 19:28:01 UTC

Severity: wishlist

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nicolas Bértolo <nicolasbertolo <at> gmail.com>
Cc: 41242 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: bug#41242: Port feature/native-comp to Windows
Date: Thu, 14 May 2020 20:28:36 +0300
> From: Nicolas Bértolo <nicolasbertolo <at> gmail.com>
> Date: Thu, 14 May 2020 13:50:48 -0300
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 41242 <at> debbugs.gnu.org
> 
> 1) Call `native-comp-unload`.
> 
> 2) This should inspect the eln file and put all the subrs defined in it on a
> list. This should also copy the original bytecode from the eln file and store it
> somewhere.
> 
> 3) Then `garbage-collect` is called. This should find all references to the
> subrs in the list and swap them atomically for references to functions
> from the bytecode.
> 
> 4) After the previous step the GC should be able to collect the DLL handle
> knowing that no references to it remain.
> 
> What do you think?

Do we really need this complexity?

> > No you are right, I don't use Windows since forever, I discovered from
> > this thread is not portable.  I guess we'll need to rename also here.
> 
> But someone needs to delete the old eln file. Let's say that we use
> GetModuleFileNameA() to know if another Emacs instance has decided to rename the
> eln file and then we delete it on close if its suffix is ".eln.old".
> 
> This algorithm has a big race condition though. If Emacs1 renames the file after
> Emacs2 has checked that it has not been renamed, then the file won't be deleted.

Why do you need to check if it's renamed?  Just rename always.

> If we put the "old eln" in the $TEMP folder this may not be a big issue though.

It is not good to move to $TEMP because that one could be on a
different volume, and Windows won't let you do that with a DLL that is
loaded into a process.




This bug report was last modified 5 years and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.