aboutsummaryrefslogtreecommitdiffstats
path: root/src/profiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiler.c')
-rw-r--r--src/profiler.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/profiler.c b/src/profiler.c
index 6943905062c..84583cec765 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -66,11 +66,11 @@ make_log (void)
66 Qnil, false); 66 Qnil, false);
67 struct Lisp_Hash_Table *h = XHASH_TABLE (log); 67 struct Lisp_Hash_Table *h = XHASH_TABLE (log);
68 68
69 /* What is special about our hash-tables is that the keys are pre-filled 69 /* What is special about our hash-tables is that the values are pre-filled
70 with the vectors we'll put in them. */ 70 with the vectors we'll use as keys. */
71 ptrdiff_t i = ASIZE (h->key_and_value) >> 1; 71 ptrdiff_t i = ASIZE (h->key_and_value) >> 1;
72 while (i > 0) 72 while (i > 0)
73 set_hash_key_slot (h, --i, make_nil_vector (max_stack_depth)); 73 set_hash_value_slot (h, --i, make_nil_vector (max_stack_depth));
74 return log; 74 return log;
75} 75}
76 76
@@ -132,13 +132,14 @@ static void evict_lower_half (log_t *log)
132 XSET_HASH_TABLE (tmp, log); /* FIXME: Use make_lisp_ptr. */ 132 XSET_HASH_TABLE (tmp, log); /* FIXME: Use make_lisp_ptr. */
133 Fremhash (key, tmp); 133 Fremhash (key, tmp);
134 } 134 }
135 eassert (EQ (Qunbound, HASH_KEY (log, i)));
135 eassert (log->next_free == i); 136 eassert (log->next_free == i);
136 137
137 eassert (VECTORP (key)); 138 eassert (VECTORP (key));
138 for (ptrdiff_t j = 0; j < ASIZE (key); j++) 139 for (ptrdiff_t j = 0; j < ASIZE (key); j++)
139 ASET (key, j, Qnil); 140 ASET (key, j, Qnil);
140 141
141 set_hash_key_slot (log, i, key); 142 set_hash_value_slot (log, i, key);
142 } 143 }
143} 144}
144 145
@@ -156,7 +157,8 @@ record_backtrace (log_t *log, EMACS_INT count)
156 ptrdiff_t index = log->next_free; 157 ptrdiff_t index = log->next_free;
157 158
158 /* Get a "working memory" vector. */ 159 /* Get a "working memory" vector. */
159 Lisp_Object backtrace = HASH_KEY (log, index); 160 Lisp_Object backtrace = HASH_VALUE (log, index);
161 eassert (EQ (Qunbound, HASH_KEY (log, index)));
160 get_backtrace (backtrace); 162 get_backtrace (backtrace);
161 163
162 { /* We basically do a `gethash+puthash' here, except that we have to be 164 { /* We basically do a `gethash+puthash' here, except that we have to be