[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18522: 24.4.50; mapcar is very slow

From: Peter Münster
Subject: bug#18522: 24.4.50; mapcar is very slow
Date: Tue, 23 Feb 2016 12:19:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

On Mon, Feb 22 2016, Eli Zaretskii wrote:

> So now the question becomes: which part of Fset_default?  I thought it
> was the loop over all the buffers, but your session seems to say it
> couldn't be.


This is what I read in buffer.h:

--8<---------------cut here---------------start------------->8---
/* Chain of all buffers, including killed ones.  */

extern struct buffer *all_buffers;

/* Used to iterate over the chain above.  */

#define FOR_EACH_BUFFER(b) \
  for ((b) = all_buffers; (b); (b) = (b)->next)
--8<---------------cut here---------------end--------------->8---

"including killed ones" !

That means, the chain gets bigger and bigger, whenever I read an article
or I reply or I send a new message or whatever.

I've added a small patch to Fset_default:

--8<---------------cut here---------------start------------->8---
                struct buffer *b;
                int i = 0;
                FOR_EACH_BUFFER (b) {
                  if (!PER_BUFFER_VALUE_P (b, idx))
                    set_per_buffer_value (b, offset, value);
                fprintf(stderr, "length of all_buffers: %d\n", i);
--8<---------------cut here---------------end--------------->8---

Let's see, how the chain grows... (or not)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]