emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109898: * alloc.c (mark_object):


From: Stefan Monnier
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]