[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 16/28] tcg: Replace region.end with region.total_size
From: |
Alex Bennée |
Subject: |
Re: [PATCH v3 16/28] tcg: Replace region.end with region.total_size |
Date: |
Tue, 08 Jun 2021 17:03:20 +0100 |
User-agent: |
mu4e 1.5.13; emacs 28.0.50 |
Richard Henderson <richard.henderson@linaro.org> writes:
> A size is easier to work with than an end point,
> particularly during initial buffer allocation.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> tcg/region.c | 29 +++++++++++++++++------------
> 1 file changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/tcg/region.c b/tcg/region.c
> index 9a1e039824..a17f342f38 100644
> --- a/tcg/region.c
> +++ b/tcg/region.c
> @@ -48,7 +48,7 @@ struct tcg_region_state {
> /* fields set at init time */
> void *start;
> void *start_aligned;
> - void *end;
> + size_t total_size; /* size of entire buffer */
> size_t n;
> size_t size; /* size of one region */
> size_t stride; /* .size + guard size */
I'd shuffle that to the end so it scans size < stride < total_size. I
see we have special handling bellow:
> @@ -279,7 +279,7 @@ static void tcg_region_bounds(size_t curr_region, void
> **pstart, void **pend)
> start = region.start;
> }
> if (curr_region == region.n - 1) {
> - end = region.end;
> + end = region.start_aligned + region.total_size;
So why isn't this end = start_aligned + (n * stride)? do we not line up
for the last region?
Anyway:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
- Re: [PATCH v3 16/28] tcg: Replace region.end with region.total_size,
Alex Bennée <=