all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109898: * alloc.c (mark_object): Revert window marking code
Date: Fri, 07 Sep 2012 11:10:47 -0400	[thread overview]
Message-ID: <jwvliglzxl1.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <5049A28B.2050506@yandex.ru> (Dmitry Antipov's message of "Fri, 07 Sep 2012 11:30:19 +0400")

> BTW, are there any reasons to reset local variables in Fkill_buffer?

It sets the buffer-local slots to the global value, so from the GC's
behavior point of view, it's the same as setting them to Qnil since
those values will be live anyway.
IOW using reset_buffer_local_variables should have pretty much the same
effect as your new nullify_buffer, except for the few fields it might miss.

BTW, have you tried to figure out what keeps those
buffers/frames/windows live?

> +/* Set all F's Lisp_Object slots to nil in attempt to let
> +   GC to sweep them early.  Setting f->terminal to NULL
> +   makes FRAME_LIVE_P false for this frame.  */
> +
> +static inline void
> +nullify_frame (struct frame *f)
> +{
> +  Lisp_Object *ptr;
> +
> +  for (ptr = &f->name; ptr <= &f->current_tool_bar_string; ptr++)
> +    *ptr = Qnil;
> +  f->terminal = NULL;
> +}
> +
>  /* Delete FRAME.  When FORCE equals Qnoelisp, delete FRAME
>    unconditionally.  x_connection_closed and delete_terminal use
>    this.  Any other value of FORCE implements the semantics
> @@ -1321,7 +1335,9 @@
>    {
>      struct terminal *terminal = FRAME_TERMINAL (f);
> f-> output_data.nothing = 0;
> -    f->terminal = 0;             /* Now the frame is dead. */
> +
> +    /* F is really dead after this.  */
> +    nullify_frame (f);
 
I actually prefer having the f->terminal=NULL where it was, so that
nullify_frame really only affects the GC behavior and is
otherwise unnoticeable.  Same for nullify_buffer.


        Stefan



      reply	other threads:[~2012-09-07 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1T9WL0-0007xs-H2@vcs.savannah.gnu.org>
     [not found] ` <jwvk3w7uxaf.fsf-monnier+emacs@gnu.org>
2012-09-07  7:30   ` [Emacs-diffs] /srv/bzr/emacs/trunk r109898: * alloc.c (mark_object): Revert window marking code Dmitry Antipov
2012-09-07 15:10     ` Stefan Monnier [this message]

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=jwvliglzxl1.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dmantipov@yandex.ru \
    --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.