emacs-devel
[Top][All Lists]
Advanced

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

Re: Dynamic modules: emacs-module.c and signaling errors


From: Paul Eggert
Subject: Re: Dynamic modules: emacs-module.c and signaling errors
Date: Wed, 25 Nov 2015 09:34:59 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 11/25/2015 12:50 AM, Daniel Colascione wrote:
Modules in C already have to handle checking for failures of their
internal allocations. What makes checking for failures of Emacs-side
allocations so much worse?
Allocation is more-common in Lisp-like programs than in C-like programs, so it needs to be catered to more. Traditionally, C dynamic allocation was often done on the stack, where the programmer doesn't need to manually insert code to check whether it succeeds. Lisp and module code should be as convenient as that, for 'cons'.

This raises another issue, though. Suppose Emacs detects C stack overflow and signals an exception when in the middle of a module. How does that work? We need to solve the stack-exhaustion problem independently of the details of the module API for memory allocation. And whatever method we come up with, should make it easier for us to provide convenient heap allocation too, because stack and heap exhaustion can be handled by similar mechanisms.



reply via email to

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