emacs-devel
[Top][All Lists]
Advanced

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

Re: MPS: Problem with dynamic modules


From: Gerd Möllmann
Subject: Re: MPS: Problem with dynamic modules
Date: Mon, 20 May 2024 15:23:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Gerd Möllmann <gerd.moellmann@gmail.com>
>> Cc: dancol@dancol.org,  eller.helmut@gmail.com,  emacs-devel@gnu.org
>> Date: Mon, 20 May 2024 14:07:19 +0200
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > I tried to run the emacs-module test, but it doesn't compile here:
>> >
>> >     CCLD     src/emacs-module-resources/mod-test.dll
>> >   make[1]: Entering directory `/d/gnu/git/emacs/feature/test'
>> >   In file included from src/emacs-module-resources/mod-test.c:47:
>> >   ../src/emacs-module.h:1120:26: error: unknown type name 'Lisp_Object'
>> >    1120 | struct emacs_value_tag { Lisp_Object v; };
>> >    |                          ^~~~~~~~~~~
>> >   ../src/emacs-module.h:1128:27: error: field 'header' has incomplete type
>> >    1128 |   union vectorlike_header header;
>> >    |                           ^~~~~~
>> >
>> > Does it compile for you?  Why did you move the emacs_value_tag stuff
>> > from emacs-module.c (which is compiled as part of Emacs) to
>> > emacs-module.h (which is included by modules, which aren't supposed to
>> > know about Lisp_Object, they are supposed to use emacs_value instead.
>> > But not a module cannot be compiled without including lisp.h, which I
>> > think is wrong.
>> 
>> Because of this
>> 
>>   static mps_res_t
>>   fix_global_ref (mps_ss_t ss, struct module_global_reference *r)
>>   {
>>     MPS_SCAN_BEGIN (ss)
>>     {
>>       IGC_FIX_CALL_FN (ss, struct Lisp_Vector, r, fix_vectorlike);
>>       IGC_FIX12_OBJ (ss, &r->value.v);
>>     }
>>     MPS_SCAN_END (ss);
>>     return MPS_RES_OK;
>>   }
>> 
>> a longer time ago. What would be a good fix?
>
> Move fix_global_ref (or at least its part that knows about
> module_global_reference) to emacs-module.c?
>
> There's a tangled web of data types there, and I don't know which ones
> are important (e.g., does IGC_FIX_CALL_FN really need to know the data
> type of client_addr?), but I'm quite sure some way of using an opaque
> data type can work here.  AFAIU, all you need is to supply to
> IGC_FIX_CALL_FN a value that it will pass to fix_global_ref, and it
> looks to me like both of them treat those as 'void *' pointers.  So
> the actual type is not really important, is it?

Probably not, but we also need MPS data types and macros like
MPS_FIX_CALL. That's a PITA, because it means that wherever that
function wanders, that place will need to include MPS headers, and maybe
macros from igc.

Isn't there something easier? Can emacs_value_tag be changed to
something containing s struct Lisp_X *, for example? I think that's what
native comp does, at least judging from the C that it generates.



reply via email to

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