md: use resync_max_sectors for reshape as well as resync.
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / tools / perf / util / xyarray.c
blob22afbf6c536adbb291f4ee87a35edf970722fc5a
1 #include "xyarray.h"
2 #include "util.h"
4 struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size)
6 size_t row_size = ylen * entry_size;
7 struct xyarray *xy = zalloc(sizeof(*xy) + xlen * row_size);
9 if (xy != NULL) {
10 xy->entry_size = entry_size;
11 xy->row_size = row_size;
14 return xy;
17 void xyarray__delete(struct xyarray *xy)
19 free(xy);