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.