diff options
| author | Jens Axboe <jaxboe@fusionio.com> | 2011-03-01 15:04:39 -0500 |
|---|---|---|
| committer | Jens Axboe <jaxboe@fusionio.com> | 2011-03-01 15:04:39 -0500 |
| commit | 6fae9c25134baffbeeb20031479e7ff6f6d8eec0 (patch) | |
| tree | c9ab89992ce5293a43cd455a81dc8a5926a28a5e /tools/perf/util/xyarray.c | |
| parent | c186794dbb466b45cf40f942f2d09d6d5b4b0e42 (diff) | |
| parent | f5412be599602124d2bdd49947b231dd77c0bf99 (diff) | |
Merge commit 'v2.6.38-rc6' into for-2.6.39/core
Conflicts:
block/cfq-iosched.c
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'tools/perf/util/xyarray.c')
| -rw-r--r-- | tools/perf/util/xyarray.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/perf/util/xyarray.c b/tools/perf/util/xyarray.c new file mode 100644 index 000000000000..22afbf6c536a --- /dev/null +++ b/tools/perf/util/xyarray.c | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #include "xyarray.h" | ||
| 2 | #include "util.h" | ||
| 3 | |||
| 4 | struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size) | ||
| 5 | { | ||
| 6 | size_t row_size = ylen * entry_size; | ||
| 7 | struct xyarray *xy = zalloc(sizeof(*xy) + xlen * row_size); | ||
| 8 | |||
| 9 | if (xy != NULL) { | ||
| 10 | xy->entry_size = entry_size; | ||
| 11 | xy->row_size = row_size; | ||
| 12 | } | ||
| 13 | |||
| 14 | return xy; | ||
| 15 | } | ||
| 16 | |||
| 17 | void xyarray__delete(struct xyarray *xy) | ||
| 18 | { | ||
| 19 | free(xy); | ||
| 20 | } | ||
