Skip to content

Commit 9875ff7

Browse files
committed
Explaining the purpose of the calls variable in response to <Ravenbrook/mps#164 (comment)>.
1 parent d92239c commit 9875ff7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mps/code/amcss.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ static void report(void)
9595

9696
static mps_addr_t make(size_t rootsCount)
9797
{
98-
static volatile unsigned long calls = 0; /* for use from debugger */
98+
/* The calls variable is useful when debugging to stop the debugging
99+
after a certain number of allocations using a debugger
100+
"watchpoint". Allocations are a good "clock tick" for this test.
101+
The test itself doesn't use the variable, so we declare it
102+
volatile, which also forces updates into memory. */
103+
static volatile unsigned long calls = 0;
99104
size_t length = rnd() % (scale * avLEN);
100105
size_t size = (length+2) * sizeof(mps_word_t);
101106
mps_addr_t p;

0 commit comments

Comments
 (0)