unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Daniel Colascione <dancol@dancol.org>
Cc: emacs-devel@gnu.org
Subject: Re: Conservative GC isn't safe
Date: Mon, 28 Nov 2016 14:33:13 -0500	[thread overview]
Message-ID: <jwvk2bnmmx9.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <f56b45c5-7248-ed09-1f9f-92c134dc4a71@dancol.org> (Daniel Colascione's message of "Mon, 28 Nov 2016 11:18:32 -0800")

> It's not just strings and buffers and intervals.

The case of intervals is different because pointers to them from the
stack aren't recognized by our conservative stack scanner (CSS), so they're
more at risk, regardless of funny compiler shenanigans.

> What about cons cells?  There's nothing wrong with getting a cons from
> something, doing something that might GC with its car, then doing
> something that might GC with its cdr.  There's nothing stopping the
> compiler from keeping a pointer to the cdr instead of the car and
> indexing when it's time to dereference the cons and get the cdr out
> of it.

Read Boehm&Chase's article: indeed, it's legal for compilers to do that.

But Emacs is not the only program using CSS, so there is some amount of
pressure to try and make sure C compilers don't make life impossible
for CSS.

> Let me ask again: we already have all the runtime data we need for more
> conservative GC. Where is the resistance to the idea coming from?

A few reasons I can think of for this inertia:
- The problem is hypothetical.
- Even if you pay attention to internal pointers, there are still
  (hypothetical) cases that won't be caught.
- Noone volunteered to write it.
- It will likely increase the CPU cost of stack scanning.
- It will likely increase the amount of garbage we erroneously keep alive.


        Stefan



  reply	other threads:[~2016-11-28 19:33 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-26  8:11 Conservative GC isn't safe Daniel Colascione
2016-11-26  8:30 ` Paul Eggert
2016-11-26  8:33   ` Daniel Colascione
2016-11-26  9:01     ` Eli Zaretskii
2016-11-26  9:04       ` Daniel Colascione
2016-11-26  9:24         ` Eli Zaretskii
2016-11-26 15:05         ` Stefan Monnier
2016-11-26 15:21           ` Camm Maguire
2016-11-28 17:51           ` Daniel Colascione
2016-11-28 18:00             ` Eli Zaretskii
2016-11-28 18:03               ` Daniel Colascione
2016-11-28 18:50                 ` Eli Zaretskii
2016-11-28 18:03             ` Stefan Monnier
2016-11-28 19:18               ` Daniel Colascione
2016-11-28 19:33                 ` Stefan Monnier [this message]
2016-11-28 19:37                 ` Eli Zaretskii
2016-11-28 19:40                   ` Daniel Colascione
2016-11-28 20:03                     ` Eli Zaretskii
2016-11-28 20:09                       ` Daniel Colascione
2016-11-28 19:26               ` Andreas Schwab
2016-11-28 19:34                 ` Stefan Monnier
2016-11-26 15:03   ` Stefan Monnier
2016-11-26 15:12     ` Eli Zaretskii
2016-11-26 16:29       ` Stefan Monnier
2016-11-26 16:42         ` Eli Zaretskii
2016-11-26 18:43           ` Stefan Monnier
2016-11-27  6:17     ` Ken Raeburn
2016-11-27 15:39       ` Eli Zaretskii
2016-11-28  9:50         ` Ken Raeburn
2016-11-28 15:55           ` Eli Zaretskii
2016-11-27 16:15       ` Paul Eggert
2016-11-28  9:36         ` Ken Raeburn
2016-11-28 15:55           ` Eli Zaretskii
2016-11-28 16:15             ` Stefan Monnier
2016-11-28 17:37               ` Eli Zaretskii
2016-11-28 17:49                 ` Stefan Monnier
2016-11-28 17:57                   ` Eli Zaretskii
2016-11-28 18:05                     ` Stefan Monnier
2016-11-28 19:09                 ` Ken Raeburn
2016-11-28 19:33                   ` Eli Zaretskii
2016-11-29  8:49                     ` Ken Raeburn
2016-11-28 17:03             ` Björn Lindqvist
2016-11-28 16:13           ` Paul Eggert
2016-11-27 16:52       ` Stefan Monnier
2016-11-26 19:08 ` Pip Cet
2016-11-27  0:24   ` Paul Eggert

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvk2bnmmx9.fsf-monnier+Inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).