From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Thu, 15 Oct 2015 00:25:50 +0000 Message-ID: References: <87bnl1vmqf.fsf@lifelogs.com> <87vbj8tow4.fsf@lifelogs.com> <87r3twtagf.fsf@lifelogs.com> <85siebl7ws.fsf@stephe-leake.org> <85a90ilwmm.fsf@stephe-leake.org> <83386a6f7z.fsf@gnu.org> <85h9upjz7v.fsf@stephe-leake.org> <83wq3k3kl4.fsf@gnu.org> <85bnkwil1c.fsf@stephe-leake.org> <83pp9cwky8.fsf@gnu.org> <85a90ggf2d.fsf@stephe-leake.org> <54E0A40F.5080603@dancol.org> <83sie7un20.fsf@gnu.org> <54E0D181.2080802@dancol.org> <83r3trulse.fsf@gnu.org> <54E0D7E0.305@87.69.4.28> <83h9unukbg.fsf@gnu.org> <54E0DEF8.7020901@dancol> <83egpruiyp.fsf@gnu.org> <54E0FF93.2000104@dancol.org> <5610ED13.1010406@dancol.org> <56117F37.9060808@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d043bdbe62f5d16052219b9f3 X-Trace: ger.gmane.org 1444868876 12370 80.91.229.3 (15 Oct 2015 00:27:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2015 00:27:56 +0000 (UTC) Cc: Eli Zaretskii , Daniel Colascione , Stephen Leake , Emacs development discussions To: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 15 02:27:55 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZmWOe-00007N-IS for ged-emacs-devel@m.gmane.org; Thu, 15 Oct 2015 02:27:52 +0200 Original-Received: from localhost ([::1]:45172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmWOd-0008Fr-Rw for ged-emacs-devel@m.gmane.org; Wed, 14 Oct 2015 20:27:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmWMt-0008EX-Q8 for emacs-devel@gnu.org; Wed, 14 Oct 2015 20:26:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmWMs-0002aZ-TS for emacs-devel@gnu.org; Wed, 14 Oct 2015 20:26:03 -0400 Original-Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:34690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmWMq-0002Zz-I5; Wed, 14 Oct 2015 20:26:00 -0400 Original-Received: by wicgb1 with SMTP id gb1so6101766wic.1; Wed, 14 Oct 2015 17:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=Xomm52GeiY9z1NcuAqCKTgwrjyJjPo4m/sqk/aNpjrQ=; b=zhM2tYfxKUOICL5VBHze3cvdTetjCq2MrDyHXU0oo5V1cA32R39MW7R9WsaDOon1fk 1sginy4fo/rReD90Jd+sKJbwQLezGDcuSRAEMUsYGR7uCDQ/ogr2Y6laT5gsymujZRjQ MTUoJIH6kXqwElpkWiVZSfDS1EQNdfX3RN4osMVvJ03DsrIeE+h5CSy0hoRl00AhEFet uaC+AP0ATHH0HfhEFjd1AWxgYxooOVRvmlVQN07K1GmC6AwYgLe9c/5iA6tu+DUlHKUu y4TZAN0G8x4oJ4ZNHJVdlOPuF2LI8j2CzOinskVfH/XpoVTaDloxtIJX8llFS0+zgOvS UTDw== X-Received: by 10.180.104.69 with SMTP id gc5mr6228270wib.69.1444868759967; Wed, 14 Oct 2015 17:25:59 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:191601 Archived-At: --f46d043bdbe62f5d16052219b9f3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Aur=C3=A9lien Aptel schrieb am Do., 15. Ok= t. 2015 um 01:48 Uhr: > On Thu, Oct 15, 2015 at 12:25 AM, Philipp Stephani > wrote: > > static Lisp_Object value_to_lisp (emacs_value value) { > > return value->v; > > } > > > > static emacs_value lisp_to_value (Lisp_Object object) { > > emacs_value v =3D (emacs_value) malloc(sizeof v); > > // The allocation needs to be smarter, this example leaks memory. > > if (!v) return 0; > > v->v =3D object; > > return v; > > } > > I'm not a big fan of a dynamically allocating memory for each > conversion, it's too expensive. Daniel solution seems more manageable. > Agreed. I've implemented Daniel's suggestion on the tls-error branch, it seems to work fine (but note that environments are now no longer global, so storing away emacs_values without global references now will lead to undefined behavior). > > By the way, I've merged your tls-errors branch in mine. Cool, thanks! > But the API > doesn't have an unsafe funcall iiuc. That's fine with me but Stefan > was insistent on that. > Let's see what will get accepted upstream. --f46d043bdbe62f5d16052219b9f3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Aur=C3= =A9lien Aptel <aurel= ien.aptel+emacs@gmail.com> schrieb am Do., 15. Okt. 2015 um 01:48=C2= =A0Uhr:
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>

Agreed. I've implemented Daniel'= ;s suggestion on the tls-error branch, it seems to work fine (but note that= environments are now no longer global, so storing away emacs_values withou= t global references now will lead to undefined behavior).
=C2=A0<= /div>

By the way, I've merged your tls-errors branch in mine.

Cool, thanks!
=C2=A0
But the API
doesn't have an unsafe funcall iiuc. That's fine with me but Stefan=
was insistent on that.

Let's see wh= at will get accepted upstream.=C2=A0
--f46d043bdbe62f5d16052219b9f3--