emacs-devel
[Top][All Lists]
Advanced

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

Re: eval proposals


From: Paul Eggert
Subject: Re: eval proposals
Date: Fri, 06 Jun 2014 09:17:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Dmitry Antipov wrote:

1) Protection against C stack overflow caused by enormously huge
    `max-lisp-eval-depth'.

Can't we rely on the virtual memory hardware to have a guard page, so that Emacs doesn't need to check for stack overflow in software? That is, Emacs could trap the SIGSEGV and do the right thing.

Perhaps we do need a software check on some platforms, but in that case 'stack_guard' should be a static function, not a macro. Also, it does some computation that could be done once, so that checking for stack overflow is just a compare-and-branch.

2) Capability to shrink specpdl stack if it becomes too large.

Multiplying (specpdl_ptr - specpdl) by SPECPDL_SHRINK_FACTOR could have problems if the multiplication overflows. Choose a power-of-two SPECPDL_SHRINK_FACTOR so that you can do the overflow test quickly by division (unsigned right shift) instead.



reply via email to

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