[Top][All Lists]

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

Re: Module support: No environment in pointer release function

From: Philipp Stephani
Subject: Re: Module support: No environment in pointer release function
Date: Tue, 07 Feb 2017 12:50:24 +0000

Elias Mårtenson <address@hidden> schrieb am Fr., 3. Feb. 2017 um 03:56 Uhr:
I'm currently building an Emacs module to provide access to GSSAPI. In it, I have to use the make_user_ptr() function in a few places. When creating a user_ptr, the function accepts a pointer to a function which will be called when the object is GC'ed.

The problem is that the free function is only called with a single argument; the pointer itself. In my case, the underlying GSSAPI function that releases the object may return some diagnostics, and I would like to be able to call the Elisp function ‘warn’ with a message describing what happened.

I think that the callback should accept 3 arguments instead of 1. In addition to the pointer itself, the ‘emacs_env’ pointer is needed. An arbitrary ‘void *data’ pointer would be useful too.

This would require two things:
- It would need to be possible to run arbitrary Lisp code during GC. I don't think that's the case right now.
- It would require a second type of user pointer because the existing one is already published.

The second requirement wouldn't be a big deal from a technical perspective, but would make the interface more complex, and I don't know whether it's a good tradeoff just to show a warning. The first requirement would likely be a deal-breaker.

reply via email to

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