Lines Matching refs:offset

32    uint64_t offset;
69 assert(hole->offset > 0);
76 assert(hole->size + hole->offset == 0 ||
77 hole->size + hole->offset > hole->offset);
81 * hole->size + hole->offset == prev_offset, then we failed to join
84 assert(hole->size + hole->offset > hole->offset &&
85 hole->size + hole->offset < prev_offset);
87 prev_offset = hole->offset;
96 uint64_t offset, uint64_t size)
98 assert(hole->offset <= offset);
99 assert(hole->size >= offset - hole->offset + size);
101 if (offset == hole->offset && size == hole->size) {
108 assert(offset - hole->offset <= hole->size - size);
109 uint64_t waste = (hole->size - size) - (offset - hole->offset);
116 if (offset == hole->offset) {
118 hole->offset += size;
127 high_hole->offset = offset + size;
133 hole->size = offset - hole->offset;
156 /* Compute the offset as the highest address where a chunk of the
160 * hole->size + hole->offset can only overflow to 0 and size > 0.
162 uint64_t offset = (hole->size - size) + hole->offset;
164 /* Align the offset. We align down and not up because we are
167 offset = (offset / alignment) * alignment;
169 if (offset < hole->offset)
172 util_vma_hole_alloc(hole, offset, size);
174 return offset;
181 uint64_t offset = hole->offset;
183 /* Align the offset */
184 uint64_t misalign = offset % alignment;
190 offset += pad;
193 util_vma_hole_alloc(hole, offset, size);
195 return offset;
205 uint64_t offset, uint64_t size)
207 /* An offset of 0 is reserved for allocation failure. It is not a valid
210 assert(offset > 0);
215 /* It's possible for offset + size to wrap around if we touch the top of
218 assert(offset + size == 0 || offset + size > offset);
222 if (hole->offset > offset)
226 * hole->offset <= is our hole. If it's not big enough to contain the
229 assert(hole->offset <= offset);
230 if (hole->size < offset - hole->offset + size)
233 util_vma_hole_alloc(hole, offset, size);
243 uint64_t offset, uint64_t size)
245 /* An offset of 0 is reserved for allocation failure. It is not a valid
248 assert(offset > 0);
253 /* It's possible for offset + size to wrap around if we touch the top of
256 assert(offset + size == 0 || offset + size > offset);
263 if (hole->offset <= offset) {
271 assert(offset + size <= high_hole->offset);
272 bool high_adjacent = high_hole && offset + size == high_hole->offset;
275 assert(low_hole->offset + low_hole->size > low_hole->offset);
276 assert(low_hole->offset + low_hole->size <= offset);
278 bool low_adjacent = low_hole && low_hole->offset + low_hole->size == offset;
290 high_hole->offset = offset;
296 hole->offset = offset;
317 fprintf(fp, "%s hole: offset = %"PRIu64" (0x%"PRIx64", "
319 tab, hole->offset, hole->offset, hole->size, hole->size);