all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: BT Templeton <bpt@hcoop.net>
Cc: emacs-devel@gnu.org
Subject: Re: Spare memory
Date: Wed, 13 Jun 2012 19:12:13 -0400	[thread overview]
Message-ID: <jwvy5nq7qrq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87d353qb0v.fsf@olor.terpri.org> (BT Templeton's message of "Wed,  13 Jun 2012 15:14:56 -0400")

> The `refill_memory_reserve' function (in alloc.c) is a no-op if
> SYSTEM_MALLOC is defined, so the spare memory is never actually
> allocated. Is this intentional?

I do not really understand enough about the way we try to handle
out-of-memory situations to be able to answer.

> Also, why doesn't `memory_full' collect garbage immediately when memory
> is exhausted? (Currently it sets `memory_full_cons_threshold', which is
> checked in `Feval' and `Ffuncall'.)

But I can answer this one: the GC can only be called at a few safe
points, so calling it from memory_full might be unsafe.  With the
conservative stack scanning, we can probably safely run the GC in many
more cases, but when using the GCPROs, the only safe spots are when
`eval' can be called.


        Stefan



  reply	other threads:[~2012-06-13 23:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 19:14 Spare memory BT Templeton
2012-06-13 23:12 ` Stefan Monnier [this message]
2012-06-14  6:46   ` Andreas Schwab

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=jwvy5nq7qrq.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bpt@hcoop.net \
    --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 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.