comparison src/alloc.c @ 10649:52cdd8cc8d3e

(mark_perdisplays): New function. (Fgarbage_collect): Call it.
author Karl Heuer <kwzh@gnu.org>
date Fri, 03 Feb 1995 23:23:34 +0000
parents 07d8c5ac0f60
children 337c3a4d5fef
comparison
equal deleted inserted replaced
10648:0871d1c3cb26 10649:52cdd8cc8d3e
128 int stack_copy_size; 128 int stack_copy_size;
129 129
130 /* Non-zero means ignore malloc warnings. Set during initialization. */ 130 /* Non-zero means ignore malloc warnings. Set during initialization. */
131 int ignore_warnings; 131 int ignore_warnings;
132 132
133 static void mark_object (), mark_buffer (); 133 static void mark_object (), mark_buffer (), mark_perdisplays ();
134 static void clear_marks (), gc_sweep (); 134 static void clear_marks (), gc_sweep ();
135 static void compact_strings (); 135 static void compact_strings ();
136 136
137 /* Versions of malloc and realloc that print warnings as memory gets full. */ 137 /* Versions of malloc and realloc that print warnings as memory gets full. */
138 138
1356 { 1356 {
1357 mark_object (&backlist->args[i]); 1357 mark_object (&backlist->args[i]);
1358 XMARK (backlist->args[i]); 1358 XMARK (backlist->args[i]);
1359 } 1359 }
1360 } 1360 }
1361 mark_perdisplays ();
1361 1362
1362 gc_sweep (); 1363 gc_sweep ();
1363 1364
1364 /* Clear the mark bits that we set in certain root slots. */ 1365 /* Clear the mark bits that we set in certain root slots. */
1365 1366
1773 /* If this is an indirect buffer, mark its base buffer. */ 1774 /* If this is an indirect buffer, mark its base buffer. */
1774 if (buffer->base_buffer && !XMARKBIT (buffer->base_buffer->name)) 1775 if (buffer->base_buffer && !XMARKBIT (buffer->base_buffer->name))
1775 { 1776 {
1776 XSETBUFFER (base_buffer, buffer->base_buffer); 1777 XSETBUFFER (base_buffer, buffer->base_buffer);
1777 mark_buffer (base_buffer); 1778 mark_buffer (base_buffer);
1779 }
1780 }
1781
1782
1783 /* Mark the pointers in the perdisplay objects. */
1784
1785 static void
1786 mark_perdisplays ()
1787 {
1788 PERDISPLAY *perd;
1789 for (perd = all_perdisplays; perd; perd = perd->next_perdisplay)
1790 {
1791 mark_object (&perd->Vprefix_arg);
1792 mark_object (&perd->Vcurrent_prefix_arg);
1793 mark_object (&perd->kbd_buffer_frame_or_window);
1778 } 1794 }
1779 } 1795 }
1780 1796
1781 /* Sweep: find all structures not marked, and free them. */ 1797 /* Sweep: find all structures not marked, and free them. */
1782 1798