-spec gc_count(non_neg_integer(), binary()) -> non_neg_integer(). | |
gc_count(PreviousCounter, Bin) -> | |
case byte_size(Bin) of | |
N when N >= 64 -> % refc binary | |
Count = N + PreviousCounter | |
case Count >= ?THRESHOLD of | |
true -> | |
erlang:garbage_collect(), | |
0; | |
false -> | |
Count | |
end; | |
N -> % heap binary | |
PreviousCounter+N | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
The variable 'Count' is unused.
The variable 'NewCount' is unbound.