[Top][All Lists]

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

Re: Dynamic loading progress

From: Paul Eggert
Subject: Re: Dynamic loading progress
Date: Sat, 21 Nov 2015 15:10:05 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Philipp Stephani wrote:
Many modules will have needs similar to Emacs itself in
>respect, and it would be better if they didn't have to reinvent this
But what should the interface be? There are only three possibilities in C:
return a sentinel value, crash, longjmp.

There's a fourth possibility: do what Emacs does. Emacs defines its own throw-catch mechanism built atop C. C modules that need to cleanup when unwound can do so by registering via the equivalent of record_unwind_protect, and Emacs won't longjmp through them without cleaning up. This already works for xmalloc memory-exhaustion failures, and modules can just use the already-existing mechanism.

reply via email to

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