From: Eli Zaretskii <eliz@gnu.org>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: acohen@ust.hk, 54532@debbugs.gnu.org
Subject: bug#54532: [PATCH] sorting
Date: Thu, 24 Mar 2022 08:42:39 +0200 [thread overview]
Message-ID: <831qyretr4.fsf@gnu.org> (raw)
In-Reply-To: <320D86FD-5B2E-4177-9570-A8004A942E8C@acm.org> (message from Mattias Engdegård on Wed, 23 Mar 2022 21:24:16 +0100)
> From: Mattias Engdegård <mattiase@acm.org>
> Date: Wed, 23 Mar 2022 21:24:16 +0100
> Cc: Andrew Cohen <acohen@ust.hk>, 54532@debbugs.gnu.org
>
> > 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).
I understand that these objects are on the heap, but AFAIU a reference
to them is on the stack, isn't it?
> > 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.
I asked about a specific instance, not in general. That instance was
at the end of the function, right before it returns, and I wonder what
kind of optimization opportunities that could present.
next prev parent reply other threads:[~2022-03-24 6:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-22 23:59 bug#54532: [PATCH] sorting Andrew Cohen
2022-03-23 12:02 ` Lars Ingebrigtsen
2022-03-23 13:30 ` Eli Zaretskii
2022-03-23 23:43 ` Andrew Cohen
2022-03-23 13:46 ` Eli Zaretskii
2022-03-23 23:31 ` Andrew Cohen
2022-03-23 20:24 ` Mattias Engdegård
2022-03-24 6:42 ` Eli Zaretskii [this message]
2022-03-24 7:22 ` Andrew Cohen
2022-03-24 8:55 ` Eli Zaretskii
2022-03-24 9:17 ` Andrew Cohen
2022-03-24 9:55 ` Mattias Engdegård
2022-03-24 9:36 ` Mattias Engdegård
2022-03-31 12:03 ` Lars Ingebrigtsen
2022-03-31 13:58 ` Eli Zaretskii
2022-03-31 23:47 ` Andrew Cohen
2022-04-01 6:26 ` Eli Zaretskii
2022-06-07 7:06 ` Stefan Kangas
[not found] ` <877d5tgd11.fsf@ust.hk>
2022-06-07 9:07 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=831qyretr4.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=54532@debbugs.gnu.org \
--cc=acohen@ust.hk \
--cc=mattiase@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.