[igt-dev] [PATCH i-g-t v5 3/8] lib/intel_batchbuffer: Introduce intel_bb

Chris Wilson chris at chris-wilson.co.uk
Tue May 19 18:50:04 UTC 2020


Quoting Zbigniew Kempczyński (2020-05-19 19:16:09)
> +static void __reallocate_objects(struct intel_bb *ibb)
> +{
> +       uint32_t num;
> +
> +       if (ibb->num_objects == ibb->allocated_objects) {
> +               num = 4096 / sizeof(*ibb->objects);
> +               ibb->objects = realloc(ibb->objects,
> +                                      sizeof(*ibb->objects) * num);

sizeof(*ibb->objects) * (num + ibb->allocated_objects)

> +               igt_assert(ibb->objects);
> +               ibb->allocated_objects += num;
> +
> +               memset(&ibb->objects[ibb->num_objects], 0,
> +                      num * sizeof(*ibb->objects));
> +       }
> +}


More information about the igt-dev mailing list