bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#54532: [PATCH] sorting


From: Mattias Engdegård
Subject: bug#54532: [PATCH] sorting
Date: Wed, 23 Mar 2022 21:24:16 +0100

> Can you tell more why this was needed? Emacs has conservative stack marking, 
> so any Lisp object that is referred by some stack-based variable should be 
> protected from GC. Why isn't that enough in this case?

Because Lisp values are temporarily moved out to a heap allocated buffer which 
isn't traversed by the stack scanner. `record_unwind_protect_ptr_mark` can be 
seen as a generalisation of `record_unwind_protect_ptr` (because that's what it 
is).

> Is this really eassume, or is eassert better here?

No, eassume is appropriate here. It provides more optimisation opportunities.
In fact, most uses of eassert are better or just as good as eassume as long as 
there are no function calls or tricky memory dereferences.






reply via email to

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