Merge remote-tracking branch 'sysctl/master'
[linux-2.6/next.git] / tools / perf / util / xyarray.h
blobc488a07275dd2783f13360a341063de1d87eab6c
1 #ifndef _PERF_XYARRAY_H_
2 #define _PERF_XYARRAY_H_ 1
4 #include <sys/types.h>
6 struct xyarray {
7 size_t row_size;
8 size_t entry_size;
9 char contents[];
12 struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size);
13 void xyarray__delete(struct xyarray *xy);
15 static inline void *xyarray__entry(struct xyarray *xy, int x, int y)
17 return &xy->contents[x * xy->row_size + y * xy->entry_size];
20 #endif /* _PERF_XYARRAY_H_ */