comparison src/window.c @ 618:16ff693bd768

[xemacs-hg @ 2001-06-19 01:29:35 by ben] window.c: We can't actually zero out everything in the window when deleting it. set-window-configuration assumes that various slots of the deleted window are still accurate.
author ben
date Tue, 19 Jun 2001 01:29:37 +0000
parents af57a77cbc92
children b39c14581166
comparison
equal deleted inserted replaced
617:af57a77cbc92 618:16ff693bd768
1940 /* Free the extra data structures attached to windows immediately so 1940 /* Free the extra data structures attached to windows immediately so
1941 they don't sit around consuming excess space. They will be 1941 they don't sit around consuming excess space. They will be
1942 reinitialized by the window-configuration code as necessary. */ 1942 reinitialized by the window-configuration code as necessary. */
1943 finalize_window ((void *) w, 0); 1943 finalize_window ((void *) w, 0);
1944 1944
1945 /* Nobody should be accessing anything in this object any more, and 1945 /* "Nobody should be accessing anything in this object any more...",
1946 making them Qnil allows for better GC'ing in case a pointer to 1946 I said, but unfortunately that's not quite true.
1947 the dead window continues to hang around. Zero all other structs 1947 set-window-configuration undeletes the window and relies on
1948 in case someone tries to access something through them. 1948 certain items to be there already. Fuckme! we really should
1949 rewrite it in Lisp and just recreate the windows. (But does any
1950 code depend on the pointers being the same? At the very least,
1951 we should reinit everything in the window.)
1952
1953 Nobody should be accessing anything in this object any more,
1954 and making them Qnil allows for better GC'ing in case a pointer
1955 to the dead window continues to hang around. Zero all other
1956 structs in case someone tries to access something through them.
1957
1958 (So, in point of fact, we zero out all of the "saved" slots,
1959 which are obviously restored from the window config, plus the
1960 slots which were already zeroed.)
1949 1961
1950 As an example of why setting the values to Qnil is good, here 1962 As an example of why setting the values to Qnil is good, here
1951 is an old comment: 1963 is an old comment:
1952 1964
1953 In the loop 1965 In the loop
1961 Since the window-configuration code doesn't need any of the 1973 Since the window-configuration code doesn't need any of the
1962 pointers to other windows (they are all recreated from the 1974 pointers to other windows (they are all recreated from the
1963 window-config data), we set them all to nil so that we 1975 window-config data), we set them all to nil so that we
1964 are able to collect more actual garbage. */ 1976 are able to collect more actual garbage. */
1965 1977
1966 zero_lcrecord (w); 1978 #define WINDOW_SLOT(slot)
1967 1979 #define WINDOW_SAVED_SLOT(slot, compare) w->slot = Qnil;
1968 #define WINDOW_SLOT(slot) w->slot = Qnil;
1969 #include "winslots.h" 1980 #include "winslots.h"
1981
1982 w->next = Qnil;
1983 w->prev = Qnil;
1984 w->hchild = Qnil;
1985 w->vchild = Qnil;
1986 w->parent = Qnil;
1987 w->subwindow_instance_cache = Qnil;
1970 1988
1971 w->dead = 1; 1989 w->dead = 1;
1972 } 1990 }
1973 1991
1974 DEFUN ("delete-window", Fdelete_window, 0, 2, "", /* 1992 DEFUN ("delete-window", Fdelete_window, 0, 2, "", /*