From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani
On Thu, Oct 15, 2015 at 12:= 25 AM, Philipp Stephani
<p.stephani2@= gmail.com> wrote:
> static Lisp_Object value_to_lisp (emacs_value value) {
>=C2=A0 =C2=A0return value->v;
> }
>
> static emacs_value lisp_to_value (Lisp_Object object) {
>=C2=A0 =C2=A0emacs_value v =3D (emacs_value) malloc(sizeof v);
>=C2=A0 =C2=A0// The allocation needs to be smarter, this example leaks = memory.
>=C2=A0 =C2=A0if (!v) return 0;
>=C2=A0 =C2=A0v->v =3D object;
>=C2=A0 =C2=A0return v;
> }
I'm not a big fan of a dynamically allocating memory for each
conversion, it's too expensive. Daniel solution seems more manageable.<= br>
By the way, I've merged your tls-errors branch in mine.
But the API
doesn't have an unsafe funcall iiuc. That's fine with me but Stefan=
was insistent on that.