>>>> "Ben" == Ben Wing <ben(a)xemacs.org>
writes:
Ben> please try following my comment. just delete the line.
Ben> don't do anything else. no need to update window mirrors
No problem if it's the right thing to do.
I was wondering why you didn't do it and assumed it couldn't possibly
be that simple.
Ben> prior to gc.
Do you agree also, Andy?
Ben> Adrian Aichner wrote:
>
> >>>>> "Andy" == Andy Piper <andyp(a)bea.com> writes:
>
Andy> At 05:08 PM 1/20/02 +0100, Adrian Aichner wrote:
> >> >>>>> "Andy" == Andy Piper
<andyp(a)bea.com> writes:
> >>
Andy> I think we should do what Ben says and try commenting
out
Andy> the call to update_window_scrollbars. The alternative would
> >>
> >> Something like this?
> >>
> >> Index: window.c
> >> ===================================================================
> >> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/window.c,v
> >> retrieving revision 1.52.2.1.2.3
> >> diff -u -u -r1.52.2.1.2.3 window.c
> >> --- window.c 2001/12/01 05:54:21 1.52.2.1.2.3
> >> +++ window.c 2002/01/20 15:52:49
> >> @@ -386,9 +386,6 @@
mir-> current_display_lines = Dynarr_new
(display_line);
mir-> desired_display_lines = Dynarr_new (display_line);
> >>
> >> -#ifdef HAVE_SCROLLBARS
> >> - update_window_scrollbars (XWINDOW (win), mir, 0, 0);
> >> -#endif
mir-> buffer = NULL;
> >> }
>
Andy> No I mean in mark_redisplay(). We should update the window
mirrors
Andy> before going into GC.
>
> Perhaps I misunderstood, but:
>
> Once we are in mark_redisplay, GC is already in progress. It's too
> late to do something pre-gc.
>
> Where would I put the
> register_pre_gc_action (...);
> call which should do the following:
>
> FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
> {
> struct frame *f = XFRAME (XCAR (frmcons));
> /* #### urk! this does tons o' crap, such as creating lots of
> structs, doing window system actions, etc. we DO NOT want to
> be doing this -- marking should never change any state.
> i think we can just delete this. --ben */
> /*
> Prompted by Ben's note above and following advice from Andy I
> am trying to do this via newly implemented pre_gc_action --
> Adrian.
> */
> update_frame_window_mirror, f);
> }
>
> post_gc actions are set up like this:
>
> if (gc_in_progress)
> /* #### way bogus! need to remove the offending call.
> see mark_redisplay(). */
> register_post_gc_action (unshow_that_mofo,
> (void *) SCROLLBAR_MSW_HANDLE (sb));
>
> but we can't do the same for pre:
>
> if (gc_in_progress)
> register_post_gc_action (...);
> couldn't possibly work, right :-)
> It would only do it previous to the next GC.
>
> Are you suggesting the following should also be reworked to pre_gc?
>
> static void
> mswindows_release_scrollbar_instance (struct scrollbar_instance *sb)
> {
> if (gc_in_progress)
> /* #### way bogus! need to remove the offending call.
> see mark_redisplay(). */
> register_post_gc_action (unshow_that_mofo,
> (void *) SCROLLBAR_MSW_HANDLE (sb));
> else
> ShowScrollBar (SCROLLBAR_MSW_HANDLE (sb), SB_CTL, 0);
> SCROLLBAR_MSW_SIZE (sb) = 0;
> }
>
> Ready for a vacation,
>
> Adrian
>
Andy> be to do this before we go into GC. We could do this by
Andy> having a run_pre_gc_actions which does the same as
Andy> run_post_gc_actions and then does the update there. I don't
> >>
> >> I wonder why the implementer of run_post_gc_actions has not
> >> implemented run_pre_gc_actions as well. Could you think of a reason
> >> why this would not be a good idea?
>
Andy> The reason Ben did not do this is because run_post_gc_actions is
Andy> supposed to be used for cleaning up things that cannot be deleted in
Andy> GC (e.g. GUI windows). Before GC is run this condition does not
Andy> exist. However, there is no reason I can think of why this isn't a
Andy> good idea.
>
> >> What would we set up for register_pre_gc_action?
> >>
> >> Just a function doing
> >>
> >> #ifdef HAVE_SCROLLBARS
> >> update_window_scrollbars (XWINDOW (win), mir, 0, 0);
> >> #endif
> >>
> >> perhaps?
>
Andy> Right, but looping over all frames as per mark_redisplay()
>
Andy> andy
>
>> --
>> Adrian Aichner
>> mailto:adrian@xemacs.org
>>
http://www.xemacs.org/
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/