Closes #44. Solves the overflow crash from accumulating remembered_size across collect cycles. I'm by no means an expert on this crate, so please check this thoroughly.
It seems like remembered_size was meant to be a running total through one collection cycle, but was not being reset to zero at the end of sweeping like allocation_debt was. To solve this, I just set it to zero along with allocation_debt and use the old value in the calculation of sleep for wakeup_total.
I've also included a regression test that makes sure that several similar values in Context all remain bounded. Unfortunately this required exposing a new public method in Arena for getting the value of remembered_size. Feel free to make changes if this can be avoided. I would have normally made it pub(crate), but the test module is not actually part of the crate it seems.
Closes #44. Solves the overflow crash from accumulating
remembered_size
across collect cycles. I'm by no means an expert on this crate, so please check this thoroughly.It seems like
remembered_size
was meant to be a running total through one collection cycle, but was not being reset to zero at the end of sweeping likeallocation_debt
was. To solve this, I just set it to zero along withallocation_debt
and use the old value in the calculation ofsleep
forwakeup_total
.I've also included a regression test that makes sure that several similar values in
Context
all remain bounded. Unfortunately this required exposing a new public method inArena
for getting the value ofremembered_size
. Feel free to make changes if this can be avoided. I would have normally made itpub(crate)
, but the test module is not actually part of the crate it seems.