Lines Matching refs:array

9 /* xfile array index type, along with cursor initialization */
13 /* Iterate each index of an xfile array. */
14 #define foreach_xfarray_idx(array, idx) \
16 (idx) < xfarray_length(array); \
20 /* Underlying file that backs the array. */
23 /* Number of array elements. */
26 /* Maximum possible array size. */
29 /* Number of unset slots in the array below @nr. */
32 /* Size of an array element. */
35 /* log2 of array element size, if possible. */
41 void xfarray_destroy(struct xfarray *array);
42 int xfarray_load(struct xfarray *array, xfarray_idx_t idx, void *ptr);
43 int xfarray_unset(struct xfarray *array, xfarray_idx_t idx);
44 int xfarray_store(struct xfarray *array, xfarray_idx_t idx, const void *ptr);
45 int xfarray_store_anywhere(struct xfarray *array, const void *ptr);
46 bool xfarray_element_is_null(struct xfarray *array, const void *ptr);
49 * Load an array element, but zero the buffer if there's no data because we
50 * haven't stored to that array element yet.
54 struct xfarray *array,
58 int error = xfarray_load(array, idx, rec);
61 memset(rec, 0, array->obj_size);
67 /* Append an element to the array. */
68 static inline int xfarray_append(struct xfarray *array, const void *ptr)
70 return xfarray_store(array, array->nr, ptr);
73 uint64_t xfarray_length(struct xfarray *array);
74 int xfarray_load_next(struct xfarray *array, xfarray_idx_t *idx, void *rec);
85 struct xfarray *array,
89 int ret = xfarray_load_next(array, idx, rec);
98 /* Declarations for xfile array sort functionality. */
110 struct xfarray *array;
130 /* First array index in folio that is completely readable */
133 /* Last array index in folio that is completely readable */
148 * Pretend that we have a typedef for array records:
150 * typedef char[array->obj_size] xfarray_rec_t;
164 * Otherwise, we want to partition the records to partition the array.
167 * The format of the qsort_pivot array enables us to use the kernel
184 int xfarray_sort(struct xfarray *array, xfarray_cmp_fn cmp_fn,