/* Make a list of COUNT Lisp_Objects, where ARG is the
first one. Allocate conses from pure space if TYPE
- is PURE, or allocate as usual if type is HEAP. */
+ is CONSTYPE_PURE, or allocate as usual if type is CONSTYPE_HEAP. */
Lisp_Object
listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...)
for (i = 0, val = Qnil; i < count; i++)
{
- if (type == PURE)
+ if (type == CONSTYPE_PURE)
val = pure_cons (objp[i], val);
- else if (type == HEAP)
+ else if (type == CONSTYPE_HEAP)
val = Fcons (objp[i], val);
else
abort ();
doc: /* Return a newly allocated marker which does not point at any place. */)
(void)
{
- register Lisp_Object marker = allocate_misc (Lisp_Misc_Marker);
+ register Lisp_Object val;
+ register struct Lisp_Marker *p;
- init_marker (XMARKER (marker), NULL, 0, 0, 0);
- return marker;
+ val = allocate_misc (Lisp_Misc_Marker);
+ p = XMARKER (val);
+ p->buffer = 0;
+ p->bytepos = 0;
+ p->charpos = 0;
+ p->next = NULL;
+ p->insertion_type = 0;
+ return val;
}
/* Return a newly allocated marker which points into BUF
Lisp_Object
build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos)
{
- register Lisp_Object marker = allocate_misc (Lisp_Misc_Marker);
-
- /* Use Fmake_marker to create marker points to nowhere. */
- eassert (buf != NULL);
+ Lisp_Object obj;
+ struct Lisp_Marker *m;
/* No dead buffers here. */
eassert (!NILP (BVAR (buf, name)));
- /* In a single-byte buffer, two positions must be equal.
- Otherwise, every character is at least one byte. */
- if (BUF_Z (buf) == BUF_Z_BYTE (buf))
- eassert (charpos == bytepos);
- else
- eassert (charpos <= bytepos);
-
- init_marker (XMARKER (marker), buf, charpos, bytepos, 0);
- return marker;
+ /* Every character is at least one byte. */
+ eassert (charpos <= bytepos);
+
+ obj = allocate_misc (Lisp_Misc_Marker);
+ m = XMARKER (obj);
+ m->buffer = buf;
+ m->charpos = charpos;
+ m->bytepos = bytepos;
+ m->insertion_type = 0;
+ m->next = BUF_MARKERS (buf);
+ BUF_MARKERS (buf) = m;
+ return obj;
}
/* Put MARKER back on the free list after using it temporarily. */
case PVEC_SUBR:
break;
- case PVEC_EXCURSION:
- {
- struct Lisp_Excursion *e = (struct Lisp_Excursion *) ptr;
- /* No Lisp_Objects but two special pointers to mark here. */
- eassert (e->buffer != NULL);
- eassert (e->window != NULL);
- if (!VECTOR_MARKED_P (e->buffer))
- mark_buffer (e->buffer);
- if (!VECTOR_MARKED_P (e->window))
- mark_vectorlike ((struct Lisp_Vector *) e->window);
- }
- break;
-
case PVEC_FREE:
abort ();
(but the contents of a buffer's text do not count here). */)
(void)
{
- return listn (HEAP, 8,
+ return listn (CONSTYPE_HEAP, 8,
bounded_number (cons_cells_consed),
bounded_number (floats_consed),
bounded_number (vector_cells_consed),
/* We build this in advance because if we wait until we need it, we might
not be able to allocate the memory to hold it. */
Vmemory_signal_data
- = listn (PURE, 2, Qerror,
+ = listn (CONSTYPE_PURE, 2, Qerror,
build_pure_c_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs"));
DEFVAR_LISP ("memory-full", Vmemory_full,
#endif
}
-/* Make some symbols visible to GDB. These cannot be done as enums, like
- GCTYPEBITS or USE_LSB_TAG, since values might not be in 'int' range.
- Each symbol X has a corresponding X_VAL symbol, verified to have
- the correct value.
+/* Make some symbols visible to GDB. This section is last, so that
+ the #undef lines don't mess up later code. */
+
+/* When compiled with GCC, GDB might say "No enum type named
+ pvec_type" if we don't have at least one symbol with that type, and
+ then xbacktrace could fail. Similarly for the other enums and
+ their values. */
+union
+{
+ enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE;
+ enum enum_USE_LSB_TAG enum_USE_LSB_TAG;
+ enum Lisp_Bits Lisp_Bits;
+ enum More_Lisp_Bits More_Lisp_Bits;
+ enum pvec_type pvec_type;
+} const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0};
- This is last, so that the #undef lines don't mess up later code. */
+/* These symbols cannot be done as enums, since values might not be
+ in 'int' range. Each symbol X has a corresponding X_VAL symbol,
+ verified to have the correct value. */
#define ARRAY_MARK_FLAG_VAL PTRDIFF_MIN
#define PSEUDOVECTOR_FLAG_VAL (PTRDIFF_MAX - PTRDIFF_MAX / 2)