From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: BLOCK_INPUT in compile_pattern_1
Date: Mon, 11 Sep 2006 10:28:22 -0400 [thread overview]
Message-ID: <jwvzmd6bhu3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1GMmVP-0001tV-Kx@fencepost.gnu.org> (Richard Stallman's message of "Mon\, 11 Sep 2006 10\:11\:23 -0400")
> 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
prev parent reply other threads:[~2006-09-11 14:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-10 18:53 BLOCK_INPUT in compile_pattern_1 Stefan Monnier
2006-09-11 14:11 ` Richard Stallman
2006-09-11 14:28 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvzmd6bhu3.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.