# HG changeset patch # User Richard M. Stallman # Date 1028731052 0 # Node ID b80760a752951cea1d6f3ada3fb713150df3b422 # Parent 3e86025ff134eb21b709edda9f235ceda91d9787 (mark_object): Detect long lists for debugging. (mark_object_loop_halt): New variable. diff -r 3e86025ff134 -r b80760a75295 src/alloc.c --- a/src/alloc.c Wed Aug 07 14:32:09 2002 +0000 +++ b/src/alloc.c Wed Aug 07 14:37:32 2002 +0000 @@ -4427,6 +4427,12 @@ Lisp_Object *last_marked[LAST_MARKED_SIZE]; int last_marked_index; +/* For debugging--call abort when we cdr down this many + links of a list, in mark_object. In debugging, + the call to abort will hit a breakpoint. + Normally this is zero and the check never goes off. */ +int mark_object_loop_halt; + void mark_object (argptr) Lisp_Object *argptr; @@ -4437,6 +4443,7 @@ void *po; struct mem_node *m; #endif + int cdr_count = 0; loop: obj = *objptr; @@ -4790,10 +4797,14 @@ if (EQ (ptr->cdr, Qnil)) { objptr = &ptr->car; + cdr_count = 0; goto loop; } mark_object (&ptr->car); objptr = &ptr->cdr; + cdr_count++; + if (cdr_count == mark_object_loop_halt) + abort (); goto loop; }