all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>, Kenichi Handa <handa@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Enlarge MAX_ALLOCA?
Date: Thu, 19 Jun 2014 21:38:40 +0300	[thread overview]
Message-ID: <83lhsssq1b.fsf@gnu.org> (raw)
In-Reply-To: <jwvmwd8yd3x.fsf-monnier+emacs@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Thu, 19 Jun 2014 14:28:08 -0400
> 
> > Does anyone see problems with the change below, which raises the bar
> > for 'alloca' to 64KB?  Are there any systems out there that we care
> > about whose stack is so small as to make this dangerous?
> 
> It makes the potential max increment of stack space "per
> lisp-eval-depth" larger, and hence increases the risk that we'll eat up
> our stack before we bump into max-lisp-eval-depth.

Which functions relevant to max-lisp-eval-depth use SAFE_ALLOCA?

> The idea behind the 16KB limit is that the cost of malloc+free is likely
> to be negligible compared the filling and using 16KB of data.

I'm talking about the long-run costs, not the immediate ones.

> I think it makes a lot of sense to try and allocate this space on the
> stack when decoding file names, but why does it allocate such a huge
> buffer just to en/decode a puny file name?

That buffer is fixed in size, I don't know what.  Perhaps it's hard to
know in advance how much we will need.  I hope Handa-san could explain.

> If the malloc/free done for this encode/decode is relatively costly,
> maybe it's because we allocate too much space compared to what we use.

Again, the problem is memory fragmentation and the resulting large
footprint, not the cost of the allocation.



  reply	other threads:[~2014-06-19 18:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19 16:02 Enlarge MAX_ALLOCA? Eli Zaretskii
2014-06-19 16:23 ` David Kastrup
2014-06-19 16:48   ` Eli Zaretskii
2014-06-19 17:04     ` David Kastrup
2014-06-19 17:14       ` Eli Zaretskii
2014-06-19 17:36         ` David Kastrup
2014-06-19 17:51           ` Eli Zaretskii
2014-06-19 18:21   ` Stefan Monnier
2014-06-19 21:13     ` David Kastrup
2014-06-20  7:10       ` Eli Zaretskii
2014-06-20  8:08         ` David Kastrup
2014-06-20  8:38     ` Dmitry Antipov
2014-06-20  8:56       ` Eli Zaretskii
2014-06-20  9:26       ` Andreas Schwab
2014-06-20  9:38         ` David Kastrup
2014-06-19 18:28 ` Stefan Monnier
2014-06-19 18:38   ` Eli Zaretskii [this message]
2014-06-19 20:37     ` Stefan Monnier
2014-06-20  7:08       ` Eli Zaretskii
2014-06-20 13:02         ` Stefan Monnier
2014-06-20 13:18           ` Eli Zaretskii
2014-06-20 14:43             ` Stefan Monnier
2014-06-20 14:50               ` Eli Zaretskii
2014-06-20 15:15               ` Herring, Davis
2014-06-20 15:44                 ` Dmitry Antipov
2014-06-20 18:36                   ` Eli Zaretskii
2014-06-21 13:01     ` K. Handa
2014-06-21 13:59       ` Eli Zaretskii
2014-06-21 17:08         ` Stefan Monnier
2014-06-22  9:22         ` K. Handa
2014-06-28 14:15           ` K. Handa
2014-06-28 14:38             ` Eli Zaretskii
2014-06-21 15:19       ` David Kastrup

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=83lhsssq1b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=handa@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.