[Tarantool-patches] [PATCH 1/2] gc: use wide integer for schedule counting

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Mar 14 19:30:57 MSK 2021


Hi! Thanks for the patch!

> diff --git a/src/box/gc.c b/src/box/gc.c
> index 1f8cc818d..86c229c34 100644
> --- a/src/box/gc.c
> +++ b/src/box/gc.c
> @@ -239,15 +239,15 @@ gc_cleanup_fiber_f(va_list ap)
>  {
>  	(void)ap;
>  	while (!fiber_is_cancelled()) {
> -		int delta = gc.cleanup_scheduled - gc.cleanup_completed;
> +		int64_t delta = gc.cleanup_scheduled - gc.cleanup_completed;
>  		if (delta == 0) {
>  			/* No pending garbage collection. */
>  			fiber_sleep(TIMEOUT_INFINITY);
>  			continue;
>  		}
> -		assert(delta > 0);
>  		gc_run_cleanup();
>  		gc.cleanup_completed += delta;
> +		assert(delta > 0 && gc.cleanup_completed > 0);

You didn't need to change the assertion. If `delta` is always
positive, and `cleanup_completed` is populated only from `delta`,
it is also positive always.


More information about the Tarantool-patches mailing list