diff options
Diffstat (limited to 'ANDROID_3.4.5/tools/perf/util/xyarray.c')
-rw-r--r-- | ANDROID_3.4.5/tools/perf/util/xyarray.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ANDROID_3.4.5/tools/perf/util/xyarray.c b/ANDROID_3.4.5/tools/perf/util/xyarray.c new file mode 100644 index 00000000..22afbf6c --- /dev/null +++ b/ANDROID_3.4.5/tools/perf/util/xyarray.c @@ -0,0 +1,20 @@ +#include "xyarray.h" +#include "util.h" + +struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size) +{ + size_t row_size = ylen * entry_size; + struct xyarray *xy = zalloc(sizeof(*xy) + xlen * row_size); + + if (xy != NULL) { + xy->entry_size = entry_size; + xy->row_size = row_size; + } + + return xy; +} + +void xyarray__delete(struct xyarray *xy) +{ + free(xy); +} |