From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Dynamic modules: emacs-module.c and signaling errors Date: Wed, 25 Nov 2015 11:10:06 -0700 Message-ID: <87oaeiosqp.fsf@tromey.com> References: <83k2p7xk13.fsf@gnu.org> <87wpt7p369.fsf@tromey.com> <83d1uzxgvw.fsf@gnu.org> <5654D7CF.90001@cs.ucla.edu> <87si3vox7j.fsf@tromey.com> <56555B52.3030703@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448494920 705 80.91.229.3 (25 Nov 2015 23:42:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Nov 2015 23:42:00 +0000 (UTC) Cc: dancol@dancol.org, tzz@lifelogs.com, emacs-devel@gnu.org, p.stephani2@gmail.com, aurelien.aptel+emacs@gmail.com, Eli Zaretskii , Tom Tromey To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 26 00:41:46 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 1a1jh1-0005p7-S9 for ged-emacs-devel@m.gmane.org; Thu, 26 Nov 2015 00:41:44 +0100 Original-Received: from localhost ([::1]:48256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1jh3-0007du-Kv for ged-emacs-devel@m.gmane.org; Wed, 25 Nov 2015 18:41:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1jh0-0007do-7J for emacs-devel@gnu.org; Wed, 25 Nov 2015 18:41:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1jgx-0004B8-IA for emacs-devel@gnu.org; Wed, 25 Nov 2015 18:41:42 -0500 Original-Received: from gproxy1-pub.mail.unifiedlayer.com ([69.89.25.95]:44132) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1a1jgx-0004Ap-8L for emacs-devel@gnu.org; Wed, 25 Nov 2015 18:41:39 -0500 Original-Received: (qmail 28487 invoked by uid 0); 25 Nov 2015 23:41:31 -0000 Original-Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy1.mail.unifiedlayer.com with SMTP; 25 Nov 2015 23:41:31 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id lze21r00K2f2jeq01zgub1; Wed, 25 Nov 2015 16:41:01 -0700 X-Authority-Analysis: v=2.1 cv=Zc6OaKlA c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=zstS-IiYAAAA:8 a=PnD2wP_eR3oA:10 a=q5Y1GWT81MIA:10 a=qtqOOiqGOCEA:10 a=xhYaPeIM5ykB9j9ywiEA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=A3KmZixDVrHNs9Tt1kj2nzw6/TyK/ysrs9CHsfyFHew=; b=JzZU/CsCjHqjO2EEnkcAmaTRlmzUrj8LHpPAUTFrOq5qIbhe2ca7mDQejrBhNNT2SJGIiEGS0yZ+kNPV5Hoj5vul5G7230bWtim6WLoH8hiEkG2NToxZR7FHNcI6KlU9; Original-Received: from [174.16.156.173] (port=35000 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1a1eWK-0006jq-Jw; Wed, 25 Nov 2015 11:10:20 -0700 X-Attribution: Tom In-Reply-To: <56555B52.3030703@cs.ucla.edu> (Paul Eggert's message of "Tue, 24 Nov 2015 22:55:14 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 174.16.156.173 authed with tom+tromey.com} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 69.89.25.95 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:195268 Archived-At: >>>>> "Paul" == Paul Eggert writes: Paul> Tom Tromey wrote: >> The alternative is also error-prone though. It's very easy to forget >> that some cleanup is needed; and the Emacs facilities here aren't really >> all that easy to use either. Paul> We're talking about memory allocation here. If Emacs allocates the Paul> memory, the caller shouldn't need to clean up, as the Emacs garbage Paul> collector can do that. This should be less error-prone. The particular problem Eli mentioned was not memory allocation, it was a type-checking error. In particular see how module_extract_integer calls module_wrong_type. Tom