From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Mon, 14 Sep 2015 08:14:06 -0400 Message-ID: References: <86d1yirnqw.fsf@stephe-leake.org> <87si7977rs.fsf@tromey.com> <55DB7C3D.4090106@cs.ucla.edu> <55DE75FD.8020308@cs.ucla.edu> <55F5DD8C.70506@dancol.org> <55F62C16.4000105@dancol.org> <55F64F04.9030002@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442232867 16635 80.91.229.3 (14 Sep 2015 12:14:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2015 12:14:27 +0000 (UTC) Cc: Paul Eggert , Emacs development discussions , Philipp Stephani , =?windows-1252?Q?Aur=E9lien?= Aptel , Tom Tromey , Stephen Leake To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 14 14:14:17 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 1ZbSeG-0001qF-Fo for ged-emacs-devel@m.gmane.org; Mon, 14 Sep 2015 14:14:16 +0200 Original-Received: from localhost ([::1]:40324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbSeG-0007qw-8A for ged-emacs-devel@m.gmane.org; Mon, 14 Sep 2015 08:14:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbSeC-0007qm-P6 for emacs-devel@gnu.org; Mon, 14 Sep 2015 08:14:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbSe9-0000bE-Cw for emacs-devel@gnu.org; Mon, 14 Sep 2015 08:14:12 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:49781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbSe9-0000aT-9f for emacs-devel@gnu.org; Mon, 14 Sep 2015 08:14:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CtCwA731xV/0jo92hcgxCEAsEMCYdLBAICgTw5FAEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kLIgLCM8jAQEBAQYCAR+LOoUFB4QtBZA0pFAjhBQigngBAQE X-IPAS-Result: A0CtCwA731xV/0jo92hcgxCEAsEMCYdLBAICgTw5FAEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kLIgLCM8jAQEBAQYCAR+LOoUFB4QtBZA0pFAjhBQigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="164780483" Original-Received: from 104-247-232-72.cpe.teksavvy.com (HELO ceviche.home) ([104.247.232.72]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Sep 2015 08:14:07 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 344E3660EF; Mon, 14 Sep 2015 08:14:06 -0400 (EDT) In-Reply-To: <55F64F04.9030002@dancol.org> (Daniel Colascione's message of "Sun, 13 Sep 2015 21:37:24 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:189934 Archived-At: > Yes, but the whole point of the module system is to access non-Emacs > libraries, But the issue only comes up once these non-Emacs libraries call back to Emacs functions (i.e. step 5 in my example). So only those calls need to be protected somehow from non-local exits. > and these libraries will have its own resource tracking > systems, which won't integrate with the Emacs GC core. Right, just like the libraries we currently link to from core Emacs (libxml, libgnutls, libX, ...). They *very rarely* call back to Emacs functions. > Imagine if you had to individually arrange to call free on both the > success and error paths for every string you wanted to allocate --- > that's what life will will be like for module authors. No. Only for those who choose to use use manually-managed data. > I don't imagine most modules will be using Emacs GCed resources for I do. And I think we should encourage them to do so. For that reason we want to add finalizers, for example. >> This seems to refer to the "point 5" above. As mentioned it's easy to >> prevent the longjmp from escaping back into the surrounding non-Emacs >> (e.g. C++) code. > I agree that it's possible. I don't agree that it's easy. Of course it is. We already do that in Emacs's core with things like safe_call. Stefan