diff options
Diffstat (limited to 'tools/perf/util/xyarray.c')
-rw-r--r-- | tools/perf/util/xyarray.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/xyarray.c b/tools/perf/util/xyarray.c index 22afbf6c536a..c10ba41ef3f6 100644 --- a/tools/perf/util/xyarray.c +++ b/tools/perf/util/xyarray.c | |||
@@ -9,11 +9,19 @@ struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size) | |||
9 | if (xy != NULL) { | 9 | if (xy != NULL) { |
10 | xy->entry_size = entry_size; | 10 | xy->entry_size = entry_size; |
11 | xy->row_size = row_size; | 11 | xy->row_size = row_size; |
12 | xy->entries = xlen * ylen; | ||
12 | } | 13 | } |
13 | 14 | ||
14 | return xy; | 15 | return xy; |
15 | } | 16 | } |
16 | 17 | ||
18 | void xyarray__reset(struct xyarray *xy) | ||
19 | { | ||
20 | size_t n = xy->entries * xy->entry_size; | ||
21 | |||
22 | memset(xy->contents, 0, n); | ||
23 | } | ||
24 | |||
17 | void xyarray__delete(struct xyarray *xy) | 25 | void xyarray__delete(struct xyarray *xy) |
18 | { | 26 | { |
19 | free(xy); | 27 | free(xy); |