[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does one find out what file a library has been loaded from?

From: Andrea Corallo
Subject: Re: How does one find out what file a library has been loaded from?
Date: Sun, 24 Jul 2022 17:46:02 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andrea Corallo <akrl@sdf.org>
>> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
>> Date: Tue, 19 Jul 2022 15:32:40 +0000
>> If you have a native compiled function (say `find-file') to get the eln
>> file containing it one can use.
>> (native-comp-unit-file (subr-native-comp-unit (symbol-function #'find-file)))
> Andrea, does anything similar to subr-native-comp-unit exists for
> other types of symbols accepted by symbol-file: defvar and defface?

No it does not exists.

The reason why the compilation unit concept was introduced is to have
the GC capable of unloading the eln when possible, this mechanism is
only related to functions that are indeed memory mapped from the loaded
shared libraries.  Variables etc are just regular variables (tipically
defined at eln load time) so they didn't required any new mechanism.

> If not, then the only way to produce the same information for them
> would be to generate the base name of the .eln file with
> comp-el-to-eln-rel-filename, and then look for that file along
> native-comp-eln-load-path, right?

Yes I think so.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]