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: Sun, 22 Nov 2015 17:18:15 +0000 Message-ID: References: <876118u6f2.fsf@lifelogs.com> <8737w3qero.fsf@lifelogs.com> <831tbn9g9j.fsf@gnu.org> <878u5upw7o.fsf@lifelogs.com> <83ziya8xph.fsf@gnu.org> <83y4du80xo.fsf@gnu.org> <837fld6lps.fsf@gnu.org> <83610w5o97.fsf@gnu.org> <564FACF5.2080601@cs.ucla.edu> <564FBAA7.5030306@cs.ucla.edu> <5650F9CD.9030707@cs.ucla.edu> <83oaem2ebu.fsf@gnu.org> <83mvu62cst.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7b5d382cdb72940525244bfa X-Trace: ger.gmane.org 1448212745 5345 80.91.229.3 (22 Nov 2015 17:19:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Nov 2015 17:19:05 +0000 (UTC) Cc: aurelien.aptel+emacs@gmail.com, tzz@lifelogs.com, eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 22 18:18:49 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 1a0YHj-0005sL-Va for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 18:18:44 +0100 Original-Received: from localhost ([::1]:56857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0YHk-0003xc-3R for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 12:18:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0YHU-0003xT-Ok for emacs-devel@gnu.org; Sun, 22 Nov 2015 12:18:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0YHT-0004GS-Pu for emacs-devel@gnu.org; Sun, 22 Nov 2015 12:18:28 -0500 Original-Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:33817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0YHR-0004GE-UL; Sun, 22 Nov 2015 12:18:26 -0500 Original-Received: by wmvv187 with SMTP id v187so131961587wmv.1; Sun, 22 Nov 2015 09:18:25 -0800 (PST) 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=1eZZEAaQm5gDc2pip2OS78LB0hGslITDwmJKJVCjgwk=; b=t8/Ll9JBRxAGX9hCJCk8NpZ4iYwes8RjMF9f5tdldZ7qGGak9v4eACE5Mu7j2SZZEb I5H8f5ZZfPpZbCJziNa+kWgL8S9YMHt1pzm/pMgCjiD1Z4LoZNBqG8lHreWxS5CAefc7 ftJhDbIJ/8ZTcNJ+coa5CZ9qqGLTcRCHexvCz4H8FzcwSq70ihJiNuj5hLRwlsD+vU4H qhcXHZVXl/x6oqvRYs/C76TUoEFT/fFKoh0nufYh4wW8E2Ge/yOjI5Ujekfcn4CmkP/1 yBmnC07TMAJ6k7A63t7hqr8MZFqk7bFqMNbA1xW/6gNEQW+59k2HwvBb6Z68VgdMCmDn 4Rww== X-Received: by 10.194.19.163 with SMTP id g3mr25547909wje.166.1448212705167; Sun, 22 Nov 2015 09:18:25 -0800 (PST) In-Reply-To: <83mvu62cst.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::230 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:195041 Archived-At: --047d7b5d382cdb72940525244bfa Content-Type: multipart/alternative; boundary=047d7b5d382cdb728e0525244bf8 --047d7b5d382cdb728e0525244bf8 Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am So., 22. Nov. 2015 um 17:56 Uhr: > > From: Philipp Stephani > > Date: Sun, 22 Nov 2015 16:27:19 +0000 > > Cc: eggert@cs.ucla.edu, aurelien.aptel+emacs@gmail.com, tzz@lifelogs.com > , > > emacs-devel@gnu.org > > > > Eli Zaretskii schrieb am So., 22. Nov. 2015 um 17:23 Uhr: > > > > I don't understand: we already have in emacs-module.c machinery that > > handles non-local exits. Why cannot xmalloc do the same when it's > > called from emacs-module.c? > > > > My impression was that Paul talked about code in modules, not code in > > emacs-module.c. The latter can use xmalloc just fine, if appropriate > protection > > is installed first. > > I'll let Paul explain what he was worried about. What I was worried > about is that memory allocation done by emacs-module.c on behalf of > modules doesn't behave like xmalloc does, doesn't comply to the > MALLOC_BLOCK_INPUT protocol, and cannot be probed by MALLOC_PROBE. I > think this should be easy to fix. > > Yes, I've attached a patch. --047d7b5d382cdb728e0525244bf8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= So., 22. Nov. 2015 um 17:56=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 22 Nov 2015 16:27:19 +0000
> Cc: eggert@cs.= ucla.edu, aurelien.aptel+emacs@gmail.com, tzz@lifelogs.com,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0emacs-devel@gnu.org
>
> Eli Zaretskii <el= iz@gnu.org> schrieb am So., 22. Nov. 2015 um 17:23 Uhr:
>
>=C2=A0 =C2=A0 =C2=A0I don't understand: we already have in emacs-mo= dule.c machinery that
>=C2=A0 =C2=A0 =C2=A0handles non-local exits. Why cannot xmalloc do the = same when it's
>=C2=A0 =C2=A0 =C2=A0called from emacs-module.c?
>
> My impression was that Paul talked about code in modules, not code in<= br> > emacs-module.c. The latter can use xmalloc just fine, if appropriate p= rotection
> is installed first.

I'll let Paul explain what he was worried about.=C2=A0 What I was worri= ed
about is that memory allocation done by emacs-module.c on behalf of
modules doesn't behave like xmalloc does, doesn't comply to the
MALLOC_BLOCK_INPUT protocol, and cannot be probed by MALLOC_PROBE.=C2=A0 I<= br> think this should be easy to fix.


Yes, I've attached a patch.=C2=A0<= /div>
--047d7b5d382cdb728e0525244bf8-- --047d7b5d382cdb72940525244bfa Content-Type: application/octet-stream; name="0001-Use-xmalloc-in-module-code.patch" Content-Disposition: attachment; filename="0001-Use-xmalloc-in-module-code.patch" Content-Transfer-Encoding: base64 Content-ID: <1513033ff78fadbb99f1> X-Attachment-Id: 1513033ff78fadbb99f1 RnJvbSAxNTExZmFiOTczZDBjMDU0ZjQyNzlmODU3NDEyYWUwZjNkZWUyOGFlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5pIDxwaHN0QGdvb2dsZS5jb20+CkRh dGU6IFN1biwgMjIgTm92IDIwMTUgMTg6MTQ6MjIgKzAxMDAKU3ViamVjdDogW1BBVENIXSBVc2Ug eG1hbGxvYyBpbiBtb2R1bGUgY29kZQoKLS0tCiBzcmMvZW1hY3MtbW9kdWxlLmMgfCAzMSArKysr KysrKysrKysrKysrLS0tLS0tLS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgMTYgaW5zZXJ0aW9u cygrKSwgMTUgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvc3JjL2VtYWNzLW1vZHVsZS5jIGIv c3JjL2VtYWNzLW1vZHVsZS5jCmluZGV4IDg0MDcyYjkuLjg3MDUyODAgMTAwNjQ0Ci0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