From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Re: Module support: No environment in pointer release function Date: Tue, 7 Feb 2017 11:16:25 +0800 Message-ID: References: <082f6c7c-7c0c-8747-8464-e19f7807b786@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114b5b4864157d0547e82c48 X-Trace: blaine.gmane.org 1486437395 31829 195.159.176.226 (7 Feb 2017 03:16:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2017 03:16:35 +0000 (UTC) Cc: emacs-devel To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 07 04:16:29 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cawGa-0007uG-AY for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2017 04:16:28 +0100 Original-Received: from localhost ([::1]:51796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cawGf-0008NK-Ry for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 22:16:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cawGZ-0008NF-Ro for emacs-devel@gnu.org; Mon, 06 Feb 2017 22:16:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cawGY-0007Xs-U2 for emacs-devel@gnu.org; Mon, 06 Feb 2017 22:16:27 -0500 Original-Received: from mail-ua0-x22e.google.com ([2607:f8b0:400c:c08::22e]:34457) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cawGY-0007Xl-PW for emacs-devel@gnu.org; Mon, 06 Feb 2017 22:16:26 -0500 Original-Received: by mail-ua0-x22e.google.com with SMTP id 35so75516611uak.1 for ; Mon, 06 Feb 2017 19:16:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a/WxpjWGviJgvh06Z61Rsjl4o+MCZ+bh4186dPTSZME=; b=eSjwvnu8N2kr04kZYQdBR6bxq9TJe9xprGEnEiA+k8A+Zcj0zk+B3oh5SUh/s7HDBN Dk7qPM4xE4nZen0qg168Zf4w6+rQOVEZ2aZfW0LnRFotPfQAr5SOUK6Or7New3PjM5GK YBK0jAyVMJIpHiT0oMVuQMhSBwdR62V5BxREktdxX3QQ6aUoT+MLbDpbo9IJSPve/rL+ Kz9XnhFK7ywvOs/Mq367ill8ZZO3iZUUqd2SD6WUawzoqBsDESt/lveKnuSrMSyVz9Pz M4i2xI9/9GgucNAafZqnC2zx2TGM3cb66Wr5dRFPEpOHrUl5GeEjhaz2DIN2TH4KepRx sQOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=a/WxpjWGviJgvh06Z61Rsjl4o+MCZ+bh4186dPTSZME=; b=SGYk351vFHM3Lw23f6M3T84HnmeAs0EtjVKjIEGhSki5H7QqXnfvQ72HFWVvYTw3v7 PXCQ9v9OvMzjwEJ01d8Ap2W60GhqUNuMg1BhGDoaTciSfnv+hPxgItr0MWhQ/GNb3lj4 aDcCdqfA7rat+pMOJbJz6X8unEo4EWBegDDdh/G8RE1QOvslFbd6swKnamv1NVq1s1a/ CUeKz/Qyj+D9FvVgxJuHsKK6HcLqTT/7cUWBXk3o+B2mzFn4VP1z9Gn8JJOLWfRvRx5J W1Ww2IejBZFPbHMfbTFUbT5l+EuiqPFhzosOJDqJmbhUPqOsXg3vb6LKJrK1WWfiuGRz H9+A== X-Gm-Message-State: AIkVDXLAn+cpbhcvqIIytwncbv744Eh+TM2TXu7W6asRgJNI8Q8RxAamKYEBCYRhlE4jSnTtH36ZH3Om2NjPqQ== X-Received: by 10.176.67.1 with SMTP id k1mr6520802uak.125.1486437386292; Mon, 06 Feb 2017 19:16:26 -0800 (PST) Original-Received: by 10.103.131.215 with HTTP; Mon, 6 Feb 2017 19:16:25 -0800 (PST) In-Reply-To: <082f6c7c-7c0c-8747-8464-e19f7807b786@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c08::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:212073 Archived-At: --001a114b5b4864157d0547e82c48 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 6 February 2017 at 13:33, Paul Eggert wrote: > Elias M=C3=A5rtenson wrote: > >> In >> addition to the pointer itself, the =E2=80=98emacs_env=E2=80=99 pointer = is needed. An >> arbitrary =E2=80=98void *data=E2=80=99 pointer would be useful too. >> > > Can you package up these pointers into a single data structure, and pass = a > pointer to that structure? That's what's usually done in situations like > this, and is why a single 'void *' should suffice. > I could do this, but as far as I understood, the emacs_env pointer is not guaranteed to be immutable. If it isn't immutable, then I might just as well save it to a global variable and not have to pass it through every function that needs it. What are the guarantees with regards to the emacs_env value? Regards, Elias --001a114b5b4864157d0547e82c48 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 6= February 2017 at 13:33, Paul Eggert <eggert@cs.ucla.edu> w= rote:
Elias M=C3=A5rtens= on wrote:
In
addition to the pointer itself, the =E2=80=98emacs_env=E2=80=99 pointer is = needed. An
arbitrary =E2=80=98void *data=E2=80=99 pointer would be useful too.

Can you package up these pointers into a single data structure, and pass a = pointer to that structure? That's what's usually done in situations= like this, and is why a single 'void *' should suffice.

I could do this, but as far as I understood, the emacs_env po= inter is not guaranteed to be immutable. If it isn't immutable, then I = might just as well save it to a global variable and not have to pass it thr= ough every function that needs it.

What are the guarantees with regards to the em= acs_env value?

Regards,
Elias
--001a114b5b4864157d0547e82c48--