benchmarks/gem_exec_trace: Clear all new bo handles

When reallocing the bo array, remember to set the new entries to 0.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2015-08-10 16:08:31 +01:00
parent 4c74a683c1
commit d9462e61f9

View File

@ -103,9 +103,11 @@ static void *add_bo(void *ptr)
struct trace_add_bo *t = ptr;
uint32_t bb = 0xa << 23;
if (t->handle > num_bo) {
num_bo = (t->handle + 4095) & -4096;
bo = realloc(bo, sizeof(*bo)*num_bo);
if (t->handle >= num_bo) {
int new_bo = (t->handle + 4096) & -4096;
bo = realloc(bo, sizeof(*bo)*new_bo);
memset(bo + num_bo, 0, sizeof(*bo)*(new_bo - num_bo));
num_bo = new_bo;
}
bo[t->handle].handle = gem_create(fd, t->size);