ptrdiff_t i;
eassert (!VECTOR_MARKED_P (ptr));
- VECTOR_MARK (ptr); /* Else mark it */
+ VECTOR_MARK (ptr); /* Else mark it. */
if (size & PSEUDOVECTOR_FLAG)
size &= PSEUDOVECTOR_SIZE_MASK;
/* Note that this size is not the memory-footprint size, but only
the number of Lisp_Object fields that we should trace.
The distinction is used e.g. by Lisp_Process which places extra
- non-Lisp_Object fields at the end of the structure. */
- for (i = 0; i < size; i++) /* and then mark its elements */
+ non-Lisp_Object fields at the end of the structure... */
+ for (i = 0; i < size; i++) /* ...and then mark its elements. */
mark_object (ptr->contents[i]);
}
if (STRING_MARKED_P (ptr))
break;
CHECK_ALLOCATED_AND_LIVE (live_string_p);
- MARK_INTERVAL_TREE (ptr->intervals);
MARK_STRING (ptr);
+ MARK_INTERVAL_TREE (ptr->intervals);
#ifdef GC_CHECK_STRING_BYTES
/* Check that the string size recorded in the string is the
- same as the one recorded in the sdata structure. */
+ same as the one recorded in the sdata structure. */
CHECK_STRING_BYTES (ptr);
#endif /* GC_CHECK_STRING_BYTES */
}
ptr = ptr->next;
if (ptr)
{
- ptrx = ptr; /* Use of ptrx avoids compiler bug on Sun */
+ ptrx = ptr; /* Use of ptrx avoids compiler bug on Sun. */
XSETSYMBOL (obj, ptrx);
goto loop;
}
case Lisp_Misc:
CHECK_ALLOCATED_AND_LIVE (live_misc_p);
- if (XMISCTYPE (obj) == Lisp_Misc_Overlay)
- mark_overlay (XOVERLAY (obj));
- else
+ if (XMISCANY (obj)->gcmarkbit)
+ break;
+
+ switch (XMISCTYPE (obj))
{
- if (XMISCANY (obj)->gcmarkbit)
- break;
+ case Lisp_Misc_Marker:
+ /* DO NOT mark thru the marker's chain.
+ The buffer's markers chain does not preserve markers from gc;
+ instead, markers are removed from the chain when freed by gc. */
XMISCANY (obj)->gcmarkbit = 1;
+ break;
- /* Note that we don't mark thru the marker's
- chain. The buffer's markers chain does not
- preserve markers from GC; instead, markers
- are removed from the chain when freed by GC. */
-
+ case Lisp_Misc_Save_Value:
+ XMISCANY (obj)->gcmarkbit = 1;
#if GC_MARK_STACK
- if (XMISCTYPE (obj) == Lisp_Misc_Save_Value)
- {
- register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj);
- /* If DOGC is set, POINTER is the address of a memory
- area containing INTEGER potential Lisp_Objects. */
- if (ptr->dogc)
- {
- Lisp_Object *p = (Lisp_Object *) ptr->pointer;
- ptrdiff_t nelt;
- for (nelt = ptr->integer; nelt > 0; nelt--, p++)
- mark_maybe_object (*p);
- }
- }
+ {
+ register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj);
+ /* If DOGC is set, POINTER is the address of a memory
+ area containing INTEGER potential Lisp_Objects. */
+ if (ptr->dogc)
+ {
+ Lisp_Object *p = (Lisp_Object *) ptr->pointer;
+ ptrdiff_t nelt;
+ for (nelt = ptr->integer; nelt > 0; nelt--, p++)
+ mark_maybe_object (*p);
+ }
+ }
#endif
+ break;
+
+ case Lisp_Misc_Overlay:
+ mark_overlay (XOVERLAY (obj));
+ break;
+
+ default:
+ abort ();
}
break;
/* The cast to struct vectorlike_header * avoids aliasing issues. */
#define XSETPSEUDOVECTOR(a, b, code) \
- XSETTYPED_PSEUDOVECTOR(a, b, \
- (((struct vectorlike_header *) \
- XUNTAG (a, Lisp_Vectorlike)) \
- ->size), \
- code)
+ XSETTYPED_PSEUDOVECTOR (a, b, \
+ (((struct vectorlike_header *) \
+ XUNTAG (a, Lisp_Vectorlike)) \
+ ->size), \
+ code)
#define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \
(XSETVECTOR (a, b), \
eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
ptrdiff_t bytepos;
};
+/* START and END are markers in the overlay's buffer, and
+ PLIST is the overlay's property list. */
+struct Lisp_Overlay
+/* An overlay's real data content is:
+ - plist
+ - buffer
+ - insertion type of both ends
+ - start & start_byte
+ - end & end_byte
+ - next (singly linked list of overlays).
+ - start_next and end_next (singly linked list of markers).
+ I.e. 9words plus 2 bits, 3words of which are for external linked lists.
+*/
+ {
+ ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */
+ unsigned gcmarkbit : 1;
+ int spacer : 15;
+ struct Lisp_Overlay *next;
+ Lisp_Object start, end, plist;
+ };
+
+/* Hold a C pointer for later use.
+ This type of object is used in the arg to record_unwind_protect. */
+struct Lisp_Save_Value
+ {
+ ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */
+ unsigned gcmarkbit : 1;
+ int spacer : 14;
+ /* If DOGC is set, POINTER is the address of a memory
+ area containing INTEGER potential Lisp_Objects. */
+ unsigned int dogc : 1;
+ void *pointer;
+ ptrdiff_t integer;
+ };
+
+
+/* A miscellaneous object, when it's on the free list. */
+struct Lisp_Free
+ {
+ ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */
+ unsigned gcmarkbit : 1;
+ int spacer : 15;
+ union Lisp_Misc *chain;
+ };
+
+/* To get the type field of a union Lisp_Misc, use XMISCTYPE.
+ It uses one of these struct subtypes to get the type field. */
+
+union Lisp_Misc
+ {
+ struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */
+ struct Lisp_Free u_free;
+ struct Lisp_Marker u_marker;
+ struct Lisp_Overlay u_overlay;
+ struct Lisp_Save_Value u_save_value;
+ };
+
/* Forwarding pointer to an int variable.
This is allowed only in the value cell of a symbol,
and it means that the symbol's value really lives in the
struct Lisp_Buffer_Local_Value
{
/* 1 means that merely setting the variable creates a local
- binding for the current buffer */
+ binding for the current buffer. */
unsigned int local_if_set : 1;
/* 1 means this variable can have frame-local bindings, otherwise, it is
can have buffer-local bindings. The two cannot be combined. */
unsigned int frame_local : 1;
/* 1 means that the binding now loaded was found.
- Presumably equivalent to (defcell!=valcell) */
+ Presumably equivalent to (defcell!=valcell). */
unsigned int found : 1;
/* If non-NULL, a forwarding to the C var where it should also be set. */
union Lisp_Fwd *fwd; /* Should never be (Buffer|Kboard)_Objfwd. */
#define BLV_VALUE(blv) (XCDR ((blv)->valcell))
#define SET_BLV_VALUE(blv, v) (XSETCDR ((blv)->valcell, v))
-/* START and END are markers in the overlay's buffer, and
- PLIST is the overlay's property list. */
-struct Lisp_Overlay
-/* An overlay's real data content is:
- - plist
- - buffer
- - insertion type of both ends
- - start & start_byte
- - end & end_byte
- - next (singly linked list of overlays).
- - start_next and end_next (singly linked list of markers).
- I.e. 9words plus 2 bits, 3words of which are for external linked lists.
-*/
- {
- ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Overlay */
- unsigned gcmarkbit : 1;
- int spacer : 15;
- struct Lisp_Overlay *next;
- Lisp_Object start, end, plist;
- };
-
/* Like Lisp_Objfwd except that value lives in a slot in the
current kboard. */
struct Lisp_Kboard_Objfwd
int offset;
};
-/* Hold a C pointer for later use.
- This type of object is used in the arg to record_unwind_protect. */
-struct Lisp_Save_Value
- {
- ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */
- unsigned gcmarkbit : 1;
- int spacer : 14;
- /* If DOGC is set, POINTER is the address of a memory
- area containing INTEGER potential Lisp_Objects. */
- unsigned int dogc : 1;
- void *pointer;
- ptrdiff_t integer;
- };
-
-
-/* A miscellaneous object, when it's on the free list. */
-struct Lisp_Free
- {
- ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Free */
- unsigned gcmarkbit : 1;
- int spacer : 15;
- union Lisp_Misc *chain;
- };
-
-/* To get the type field of a union Lisp_Misc, use XMISCTYPE.
- It uses one of these struct subtypes to get the type field. */
-
-union Lisp_Misc
- {
- struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */
- struct Lisp_Free u_free;
- struct Lisp_Marker u_marker;
- struct Lisp_Overlay u_overlay;
- struct Lisp_Save_Value u_save_value;
- };
-
union Lisp_Fwd
{
struct Lisp_Intfwd u_intfwd;
struct Lisp_Kboard_Objfwd u_kboard_objfwd;
};
\f
-/* Lisp floating point type */
+/* Lisp floating point type. */
struct Lisp_Float
{
union