Fix obscure bug in profiprofiler
parent
a26e66e413
commit
a9adf82e70
|
@ -1,6 +1,6 @@
|
|||
IN: tools.profiler.tests
|
||||
USING: accessors tools.profiler tools.test kernel memory math
|
||||
threads alien tools.profiler.private sequences ;
|
||||
threads alien tools.profiler.private sequences compiler.units ;
|
||||
|
||||
[ t ] [
|
||||
\ length counter>>
|
||||
|
@ -42,3 +42,15 @@ threads alien tools.profiler.private sequences ;
|
|||
[ 1 ] [ \ foobaz counter>> ] unit-test
|
||||
|
||||
[ 2 ] [ \ fooblah counter>> ] unit-test
|
||||
|
||||
: recompile-while-profiling-test ( -- ) ;
|
||||
|
||||
[ ] [
|
||||
[
|
||||
333 [ recompile-while-profiling-test ] times
|
||||
{ recompile-while-profiling-test } compile
|
||||
333 [ recompile-while-profiling-test ] times
|
||||
] profile
|
||||
] unit-test
|
||||
|
||||
[ 666 ] [ \ recompile-while-profiling-test counter>> ] unit-test
|
||||
|
|
|
@ -35,8 +35,6 @@ void update_word_xt(F_WORD *word)
|
|||
/* If we just enabled the profiler, reset call count */
|
||||
if(profiling_p)
|
||||
{
|
||||
word->counter = tag_fixnum(0);
|
||||
|
||||
if(!word->profiling)
|
||||
{
|
||||
REGISTER_UNTAGGED(word);
|
||||
|
@ -71,6 +69,8 @@ void set_profiling(bool profiling)
|
|||
for(i = 0; i < length; i++)
|
||||
{
|
||||
F_WORD *word = untag_word(array_nth(untag_array(words),i));
|
||||
if(profiling)
|
||||
word->counter = tag_fixnum(0);
|
||||
update_word_xt(word);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue