@@ -4597,20 +4597,22 @@ live_vector_p (struct mem_node *m, void *p)
4597
4597
}
4598
4598
4599
4599
/* If P is a pointer into a live buffer, return the buffer.
4600
- Otherwise, return nil. M is a pointer to the mem_block for P. */
4600
+ Otherwise, return nil. M is a pointer to the mem_block for P.
4601
+ Also return killed buffers if ALL-BUFFERS is true. */
4601
4602
4602
4603
static Lisp_Object
4603
- live_buffer_holding (struct mem_node * m , void * p )
4604
+ live_buffer_holding (struct mem_node * m , void * p , bool all_buffers )
4604
4605
{
4605
- /* P must point into the block, and the buffer
4606
- must not have been killed. */
4606
+ /* P must point into the block, and the buffer must not
4607
+ have been killed unless ALL-BUFFERS is true . */
4607
4608
if (m -> type == MEM_TYPE_BUFFER )
4608
4609
{
4609
4610
struct buffer * b = m -> start ;
4610
4611
char * cb = m -> start ;
4611
4612
char * cp = p ;
4612
4613
ptrdiff_t offset = cp - cb ;
4613
- if (0 <= offset && offset < sizeof * b && !NILP (b -> name_ ))
4614
+ if (0 <= offset && offset < sizeof * b
4615
+ && (all_buffers || !NILP (b -> name_ )))
4614
4616
{
4615
4617
Lisp_Object obj ;
4616
4618
XSETBUFFER (obj , b );
@@ -4623,7 +4625,7 @@ live_buffer_holding (struct mem_node *m, void *p)
4623
4625
static bool
4624
4626
live_buffer_p (struct mem_node * m , void * p )
4625
4627
{
4626
- return !NILP (live_buffer_holding (m , p ));
4628
+ return !NILP (live_buffer_holding (m , p , false ));
4627
4629
}
4628
4630
4629
4631
/* Mark OBJ if we can prove it's a Lisp_Object. */
@@ -4681,7 +4683,7 @@ mark_maybe_object (Lisp_Object obj)
4681
4683
4682
4684
case Lisp_Vectorlike :
4683
4685
mark_p = (EQ (obj , live_vector_holding (m , po ))
4684
- || EQ (obj , live_buffer_holding (m , po )));
4686
+ || EQ (obj , live_buffer_holding (m , po , true )));
4685
4687
break ;
4686
4688
4687
4689
default :
@@ -4751,7 +4753,7 @@ mark_maybe_pointer (void *p)
4751
4753
break ;
4752
4754
4753
4755
case MEM_TYPE_BUFFER :
4754
- obj = live_buffer_holding (m , p );
4756
+ obj = live_buffer_holding (m , p , true );
4755
4757
break ;
4756
4758
4757
4759
case MEM_TYPE_CONS :
0 commit comments