* alloc.c (valid_lisp_object_p): Treat killed buffers,

buffer_defaults and buffer_local_symbols as valid objects.
Return special value to denote them.
This commit is contained in:
Dmitry Antipov 2012-09-05 16:55:03 +04:00
parent e4996ae924
commit c1ca42cae6
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
* alloc.c (valid_lisp_object_p): Treat killed buffers,
buffer_defaults and buffer_local_symbols as valid objects.
Return special value to denote them.
2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
* fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.

View file

@ -4981,7 +4981,8 @@ valid_pointer_p (void *p)
#endif
}
/* Return 1 if OBJ is a valid lisp object.
/* Return 2 if OBJ is a killed or special buffer object.
Return 1 if OBJ is a valid lisp object.
Return 0 if OBJ is NOT a valid lisp object.
Return -1 if we cannot validate OBJ.
This function can be quite slow,
@ -5002,6 +5003,9 @@ valid_lisp_object_p (Lisp_Object obj)
if (PURE_POINTER_P (p))
return 1;
if (p == &buffer_defaults || p == &buffer_local_symbols)
return 2;
#if !GC_MARK_STACK
return valid_pointer_p (p);
#else
@ -5027,7 +5031,7 @@ valid_lisp_object_p (Lisp_Object obj)
return 0;
case MEM_TYPE_BUFFER:
return live_buffer_p (m, p);
return live_buffer_p (m, p) ? 1 : 2;
case MEM_TYPE_CONS:
return live_cons_p (m, p);