#include "blockinput.h"
#include "charset.h"
#include "syssignal.h"
+#include "termhooks.h" /* For struct terminal. */
#include <setjmp.h>
/* GC_MALLOC_CHECK defined means perform validity checks of malloc'd
EMACS_INT gcs_done; /* accumulated GCs */
static void mark_buffer P_ ((Lisp_Object));
-extern void mark_terminals P_ ((void));
+static void mark_terminal P_((struct terminal *t));
+static void mark_terminals P_ ((void));
extern void mark_kboards P_ ((void));
extern void mark_ttys P_ ((void));
extern void mark_backtrace P_ ((void));
MEM_TYPE_PROCESS,
MEM_TYPE_HASH_TABLE,
MEM_TYPE_FRAME,
+ MEM_TYPE_TERMINAL,
MEM_TYPE_WINDOW
};
}
+struct terminal *
+allocate_terminal ()
+{
+ EMACS_INT len = VECSIZE (struct terminal);
+ struct Lisp_Vector *v = allocate_vectorlike (len, MEM_TYPE_TERMINAL);
+ EMACS_INT i;
+ Lisp_Object tmp, zero = make_number (0);
+
+ for (i = 0; i < len; ++i)
+ v->contents[i] = zero;
+ v->size = len;
+ XSETTERMINAL (tmp, v); /* Add the appropriate tag. */
+
+ return (struct terminal *) v;
+}
+
struct frame *
allocate_frame ()
{
case MEM_TYPE_PROCESS:
case MEM_TYPE_HASH_TABLE:
case MEM_TYPE_FRAME:
+ case MEM_TYPE_TERMINAL:
case MEM_TYPE_WINDOW:
if (live_vector_p (m, p))
{
case MEM_TYPE_PROCESS:
case MEM_TYPE_HASH_TABLE:
case MEM_TYPE_FRAME:
+ case MEM_TYPE_TERMINAL:
case MEM_TYPE_WINDOW:
return live_vector_p (m, p);
mark_glyph_matrix (w->desired_matrix);
}
}
+ else if (GC_TERMINALP (obj))
+ {
+ CHECK_LIVE (live_vector_p);
+ mark_terminal (XTERMINAL (obj));
+ }
else if (GC_HASH_TABLE_P (obj))
{
struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
}
}
+/* Mark the Lisp pointers in the terminal objects.
+ Called by the Fgarbage_collector. */
+
+static void
+mark_terminal (struct terminal *t)
+{
+ VECTOR_MARK (t);
+ mark_object (t->param_alist);
+}
+
+static void
+mark_terminals (void)
+{
+ struct terminal *t;
+ for (t = terminal_list; t; t = t->next_terminal)
+ {
+ eassert (t->name != NULL);
+ mark_terminal (t);
+ }
+}
+
+
/* Value is non-zero if OBJ will survive the current GC because it's
either marked or does not need to be marked to survive. */