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: BLOCK_INPUT in compile_pattern_1 Date: Mon, 11 Sep 2006 10:28:22 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1157984933 31424 80.91.229.2 (11 Sep 2006 14:28:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2006 14:28:53 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 11 16:28:51 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GMmm7-000188-IJ for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2006 16:28:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMmm6-0007Qg-UM for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2006 10:28:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GMmlu-0007Mk-9s for emacs-devel@gnu.org; Mon, 11 Sep 2006 10:28:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GMmlt-0007JI-4h for emacs-devel@gnu.org; Mon, 11 Sep 2006 10:28:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMmls-0007Ir-TY for emacs-devel@gnu.org; Mon, 11 Sep 2006 10:28:24 -0400 Original-Received: from [209.226.175.25] (helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GMmn9-0001Z9-Ub; Mon, 11 Sep 2006 10:29:44 -0400 Original-Received: from localhost ([70.55.143.66]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060911142823.HZQF18394.tomts5-srv.bellnexxia.net@localhost>; Mon, 11 Sep 2006 10:28:23 -0400 Original-Received: by localhost (Postfix, from userid 20848) id DE3D96C1C7; Mon, 11 Sep 2006 10:28:22 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Mon\, 11 Sep 2006 10\:11\:23 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59689 Archived-At: > Here's another reason to avoid allocation: Emacs > processes input from X in a signal handler; processing X input may > call malloc; if input arrives while a matching routine is calling > malloc, then we're scrod. But Emacs can't just block input while > calling matching routines; then we don't notice interrupts when > they come in. So, Emacs blocks input around all regexp calls > except the matching calls, which it leaves unprotected, in the > faith that they will not malloc. */ > But I think that reason is obsolete. Nowadays regex.c defines malloc > as a macro to expand into xmalloc, which does BLOCK_INPUT. > So I think that that BLOCK_INPUT call is obsolete, > and that so is MATCH_MAY_ALLOCATE. > Do you think this is correct? I guess so, although to tell you the truth, avoiding such brittle reasoning (And code) was one of the motivations for my SYNC_INPUT patch, so now that I've implemented this patch I prefer not to think too much about what could happen in this or that corner case when SYNC_INPUT is not used. Stefan