unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: dancol@dancol.org, fabrice.popineau@gmail.com, emacs-devel@gnu.org
Subject: Re: GC and stack marking
Date: Wed, 21 May 2014 05:51:45 +0300	[thread overview]
Message-ID: <83oayroncu.fsf@gnu.org> (raw)
In-Reply-To: <jwvppj8ds9e.fsf-monnier+emacs@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Daniel Colascione <dancol@dancol.org>,  fabrice.popineau@gmail.com,  emacs-devel@gnu.org
> Date: Tue, 20 May 2014 18:03:51 -0400
> 
> > It's not a bug in GC.  The memory management scheme that Fabrice wrote
> > does not dump the heap (because doing that is problematic on Windows,
> > and requires addition of a separate section to the executable, which
> > then precludes its stripping, and has also other complexities).
> > Instead, temacs uses a private fixed-address heap that is located in a
> > static array, and whose memory is allocated by a replacement malloc
> > function.  So any address that points to memory allocated not in that
> > array, but in the real heap provided by malloc from libc, cannot be
> > safely dumped, because in the dumped Emacs it will point to some
> > random location.
> 
> OK, so why is the hash table allocated elsewhere then the other objects
> (I understand why one might want to do that, but the question is about
> what is different in the code in the case of this purify-flag hash-table
> compared to other vectors/hashtables allocated during the dump).

Because fixed-address heaps on Windows are limited to allocations
whose size is at most 0x7f000, and one of the vectors allocated for a
70K hash-table is larger than that.

> Is it just based on size?  I.e. would the same problem show up if some
> large vector were to be allocated (and not freed) before dumping?

Yes.  And not just large vectors, any large object (e.g., string).
And that's what scared me, because I can always find a solution for
the case I know of, but how to make this reliable in the face of
future changes in Emacs?

Anyway, it looks like Fabrice found a way to work around the above
limitation, so I guess this issue is no longer such a big problem.



  reply	other threads:[~2014-05-21  2:51 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 16:31 GC and stack marking Eli Zaretskii
2014-05-19 18:47 ` Paul Eggert
2014-05-19 19:14   ` Eli Zaretskii
2014-05-19 19:58     ` Paul Eggert
2014-05-19 20:03       ` Eli Zaretskii
2014-05-19 20:17         ` Paul Eggert
2014-05-20 16:37           ` Eli Zaretskii
2014-05-20 13:44 ` Stefan Monnier
2014-05-20 16:57   ` Eli Zaretskii
2014-05-20 17:54     ` Stefan Monnier
2014-05-20 19:28       ` Eli Zaretskii
2014-05-20 22:01         ` Stefan Monnier
2014-05-21  2:48           ` Eli Zaretskii
2014-05-21  3:01             ` Stefan Monnier
2014-05-21 15:39               ` Eli Zaretskii
2014-05-21 15:57                 ` Dmitry Antipov
2014-05-21 16:06                   ` Dmitry Antipov
2014-05-21 16:55                     ` Eli Zaretskii
2014-05-21 16:53                   ` Eli Zaretskii
2014-05-21 17:40                 ` Stefan Monnier
2014-05-21 17:58                   ` Eli Zaretskii
2014-05-22 15:20                     ` Eli Zaretskii
2014-05-22 16:14                       ` Stefan Monnier
2014-05-24 12:03                         ` Eli Zaretskii
2014-05-20 19:12     ` Daniel Colascione
2014-05-20 19:43       ` Eli Zaretskii
2014-05-20 22:03         ` Stefan Monnier
2014-05-21  2:51           ` Eli Zaretskii [this message]
2014-05-31  6:31   ` Florian Weimer
2014-05-31 14:24     ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2014-05-21 19:31 Barry OReilly
2014-05-21 20:13 ` Eli Zaretskii
2014-05-21 20:49   ` Barry OReilly
2014-05-22  2:43     ` Eli Zaretskii
2014-05-22  3:12       ` Daniel Colascione
2014-05-22  5:37         ` David Kastrup
2014-05-22 13:57           ` Stefan Monnier
2014-05-22 15:49         ` Eli Zaretskii
2014-05-22 14:59       ` Barry OReilly
2014-05-22 17:03         ` Eli Zaretskii

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=83oayroncu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=fabrice.popineau@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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).