aboutsummaryrefslogtreecommitdiffstats
path: root/src/profiler.c
diff options
context:
space:
mode:
authorGrégoire Jadi2013-06-12 17:06:09 +0200
committerGrégoire Jadi2013-06-12 17:06:09 +0200
commit32a590b04a10f6bbe92bc1519b9e5ba2d32cfabc (patch)
tree578be4eb2757a0716f252a269adc49fa9406556d /src/profiler.c
parent5c77269b59c8d8d88fa91ec2c949294db1bb2131 (diff)
parente6fa6da6899bf1b4877b96c450eae3934085d560 (diff)
downloademacs-32a590b04a10f6bbe92bc1519b9e5ba2d32cfabc.tar.gz
emacs-32a590b04a10f6bbe92bc1519b9e5ba2d32cfabc.zip
Merge branch 'jave-xwidget' into xwidget
Diffstat (limited to 'src/profiler.c')
-rw-r--r--src/profiler.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/profiler.c b/src/profiler.c
index 0a0a4d0bc57..aba81344c68 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -138,10 +138,8 @@ static void evict_lower_half (log_t *log)
138static void 138static void
139record_backtrace (log_t *log, EMACS_INT count) 139record_backtrace (log_t *log, EMACS_INT count)
140{ 140{
141 struct backtrace *backlist = backtrace_list;
142 Lisp_Object backtrace; 141 Lisp_Object backtrace;
143 ptrdiff_t index, i = 0; 142 ptrdiff_t index;
144 ptrdiff_t asize;
145 143
146 if (!INTEGERP (log->next_free)) 144 if (!INTEGERP (log->next_free))
147 /* FIXME: transfer the evicted counts to a special entry rather 145 /* FIXME: transfer the evicted counts to a special entry rather
@@ -151,16 +149,7 @@ record_backtrace (log_t *log, EMACS_INT count)
151 149
152 /* Get a "working memory" vector. */ 150 /* Get a "working memory" vector. */
153 backtrace = HASH_KEY (log, index); 151 backtrace = HASH_KEY (log, index);
154 asize = ASIZE (backtrace); 152 get_backtrace (backtrace);
155
156 /* Copy the backtrace contents into working memory. */
157 for (; i < asize && backlist; i++, backlist = backlist->next)
158 /* FIXME: For closures we should ignore the environment. */
159 ASET (backtrace, i, backlist->function);
160
161 /* Make sure that unused space of working memory is filled with nil. */
162 for (; i < asize; i++)
163 ASET (backtrace, i, Qnil);
164 153
165 { /* We basically do a `gethash+puthash' here, except that we have to be 154 { /* We basically do a `gethash+puthash' here, except that we have to be
166 careful to avoid memory allocation since we're in a signal 155 careful to avoid memory allocation since we're in a signal
@@ -232,7 +221,7 @@ static EMACS_INT current_sampling_interval;
232static void 221static void
233handle_profiler_signal (int signal) 222handle_profiler_signal (int signal)
234{ 223{
235 if (backtrace_list && EQ (backtrace_list->function, Qautomatic_gc)) 224 if (EQ (backtrace_top_function (), Qautomatic_gc))
236 /* Special case the time-count inside GC because the hash-table 225 /* Special case the time-count inside GC because the hash-table
237 code is not prepared to be used while the GC is running. 226 code is not prepared to be used while the GC is running.
238 More specifically it uses ASIZE at many places where it does 227 More specifically it uses ASIZE at many places where it does