emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] trunk r117912: Minor improvements to new stack-allocat


From: Eli Zaretskii
Subject: Re: [Emacs-diffs] trunk r117912: Minor improvements to new stack-allocated Lisp objects.
Date: Mon, 22 Sep 2014 18:00:27 +0300

> From: Stefan Monnier <address@hidden>
> Date: Mon, 22 Sep 2014 08:57:13 -0400
> Cc: Paul Eggert <address@hidden>, address@hidden
> 
> > SAFE_ALLOCA and friends has exactly the same problems, and I don't see
> > the way to make it absolutely safe with an existing implementations of
> > alloca.
> 
> We don't need it to be absolutely safe (it's a given that using pointers
> into stack-allocated objects is generally unsafe, unless we use some
> code analysis to try and enforce some discipline).

That's not the issue here, AFAIU.  The issue here is that if you use
SAFE_ALLOCA inside a loop, each call to it might decide to call
alloca, because the size is small enough, but the sum of all
allocations could easily exceed the stack space, certainly the 16KB
limit we want to impose on such allocations.

We don't have a lot of these in the sources, but we do have a few.

> But the rules that have to be followed need to be *very* clear and
> stated in the most obvious (or in your face) place.

Where?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]