[Top][All Lists]

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

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

From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r117912: Minor improvements to new stack-allocated Lisp objects.
Date: Mon, 22 Sep 2014 08:57:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

>> For example, build_desired_tool_bar_string has a loop, each iteration
>> of which creates temporaries; here local_list4 could exhaust the
>> stack whereas scoped_list4 is fine, and trunk bzr 117912 fixed that
>> by replacing local_list4 with scoped_list4.


> 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).

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

[ And even if we do that, someone unfamiliar with those rules will come
  up and modify "unrelated" code which end up breaking them.  ]


reply via email to

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