Lines Matching +full:index +full:- +full:page

32 #include "hb-bit-page.hh"
72 int cmp (uint32_t o_major) const { return (int) o_major - (int) major; } in cmp()
75 uint32_t index; member
105 sz >>= (page_t::PAGE_BITS_LOG_2 - 1); in alloc()
137 auto &page = pages.arrayZ[map.index]; in hash() local
138 if (unlikely (page.is_empty ())) continue; in hash()
139 h = h * 31 + hb_hash (map.major) + hb_hash (page); in hash()
153 page_t *page = page_for (g, true); if (unlikely (!page)) return; in add() local
154 page->add (g); in add()
165 page_t *page = page_for (a, true); if (unlikely (!page)) return false; in add_range() local
166 page->add_range (a, b); in add_range()
170 page_t *page = page_for (a, true); if (unlikely (!page)) return false; in add_range() local
171 page->add_range (a, major_start (ma + 1) - 1); in add_range()
175 page = page_for (major_start (m), true); if (unlikely (!page)) return false; in add_range()
176 page->init1 (); in add_range()
179 page = page_for (b, true); if (unlikely (!page)) return false; in add_range()
180 page->add_range (major_start (mb), b); in add_range()
185 /* Duplicated here from hb-machinery.hh to avoid including it. */
190 #pragma GCC diagnostic ignored "-Wcast-align" in StructAtOffsetUnaligned()
205 page_t *page = page_for (g, v); if (unlikely (v && !page)) return; in set_array() local
210 … if (g != INVALID && (v || page)) /* The v check is to optimize out the page check if v is true. */ in set_array()
211 page->set (g, v); in set_array()
214 count--; in set_array()
245 page_t *page = page_for (g, v); if (unlikely (v && !page)) return false; in set_sorted_array() local
254 … if (g != INVALID && (v || page)) /* The v check is to optimize out the page check if v is true. */ in set_sorted_array()
255 page->add (g); in set_sorted_array()
258 count--; in set_sorted_array()
280 page_t *page = page_for (g); in del() local
281 if (!page) in del()
284 page->del (g); in del()
292 // Pre-allocate the workspace that compact() will need so we can bail on allocation failure in del_pages()
293 // before attempting to rewrite the page map. in del_pages()
320 int de = (b + 1 == major_start (mb + 1))? (int) mb: ((int) mb - 1); in del_range()
323 page_t *page = page_for (a); in del_range() local
324 if (page) in del_range()
327 page->del_range (a, b); in del_range()
329 page->del_range (a, major_start (ma + 1) - 1); in del_range()
334 page_t *page = page_for (b); in del_range() local
335 if (page) in del_range()
336 page->del_range (major_start (mb), b); in del_range()
343 const page_t *page = page_for (g); in get() local
344 if (!page) in get()
346 return page->get (g); in get()
363 hb_codepoint_t c = first - 1; in intersects()
452 * workspace should be a pre-sized vector allocated to hold at exactly pages.length
463 old_index_to_page_map_index[page_map[i].index] = i; in compact()
477 page_map[old_index_to_page_map_index[i]].index = write_index; in compact_pages()
499 // Pre-allocate the workspace that compact() will need so we can bail on allocation failure in process_()
500 // before attempting to rewrite the page map. in process_()
537 count += na - a; in process_()
539 count += nb - b; in process_()
553 /* Process in-place backward. */ in process_()
558 if (page_map.arrayZ[a - 1].major == other.page_map.arrayZ[b - 1].major) in process_()
560 a--; in process_()
561 b--; in process_()
562 count--; in process_()
567 else if (page_map.arrayZ[a - 1].major > other.page_map.arrayZ[b - 1].major) in process_()
569 a--; in process_()
572 count--; in process_()
578 b--; in process_()
581 count--; in process_()
583 page_map.arrayZ[count].index = next_page++; in process_()
591 a--; in process_()
592 count--; in process_()
598 b--; in process_()
599 count--; in process_()
601 page_map.arrayZ[count].index = next_page++; in process_()
647 if (pages_array[current.index].next (codepoint)) in next()
658 hb_codepoint_t m = pages_array[current.index].get_min (); in next()
681 if (pages[page_map.arrayZ[i].index].previous (codepoint)) in previous()
687 i--; in previous()
688 for (; (int) i >= 0; i--) in previous()
690 hb_codepoint_t m = pages.arrayZ[page_map.arrayZ[i].index].get_max (); in previous()
731 while (previous (&i) && i == *first - 1) in previous_range()
732 (*first)--; in previous_range()
741 // By default, start at the first bit of the first page of values. in next_many()
759 // The export-after value was last in the page. Start on next page. in next_many()
769 unsigned int n = pages[page_map[i].index].write (base, start_page_value, out, size); in next_many()
771 size -= n; in next_many()
774 return initial_size - size; in next_many()
782 // By default, start at the first bit of the first page of values. in next_many_inverted()
799 size--; in next_many_inverted()
801 return initial_size - size; in next_many_inverted()
808 // The export-after value was last in the page. Start on next page. in next_many_inverted()
818 …unsigned int n = pages[page_map[i].index].write_inverted (base, start_page_value, out, size, &next… in next_many_inverted()
820 size -= n; in next_many_inverted()
825 size--; in next_many_inverted()
827 return initial_size - size; in next_many_inverted()
850 const auto& page = pages[map.index]; in get_min() local
852 if (!page.is_empty ()) in get_min()
853 return map.major * page_t::PAGE_BITS + page.get_min (); in get_min()
860 for (signed i = count - 1; i >= 0; i--) in get_max()
863 const auto& page = pages[map.index]; in get_max() local
865 if (!page.is_empty ()) in get_max()
866 return map.major * page_t::PAGE_BITS + page.get_max (); in get_max()
885 l = s->get_population () + 1; in iter_t()
893 void __next__ () { s->next (&v); if (l) l--; } in __next__()
894 void __prev__ () { s->previous (&v); } in __prev__()
915 * since the next check would be tricked because a null page also has in page_for()
916 * major==0, which we can't distinguish from an actually major==0 page... */ in page_for()
922 return &pages.arrayZ[cached_page.index]; in page_for()
934 pages.arrayZ[map.index].init0 (); in page_for()
937 (page_map.length - 1 - i) * page_map.item_size); in page_for()
942 return &pages.arrayZ[page_map.arrayZ[i].index]; in page_for()
949 * since the next check would be tricked because a null page also has in page_for()
950 * major==0, which we can't distinguish from an actually major==0 page... */ in page_for()
956 return &pages.arrayZ[cached_page.index]; in page_for()
964 return &pages.arrayZ[page_map[i].index]; in page_for()
969 return pages.arrayZ[page_map.arrayZ[i].index]; in page_at()
974 return pages.arrayZ[page_map.arrayZ[i].index]; in page_at()