Lines Matching refs:idx
165 #define GC_IDX2PTR(idx) (GC_G(buf) + (idx)) argument
168 #define GC_IDX2LIST(idx) ((void*)(uintptr_t)(((idx) * sizeof(void*)) | GC_UNUSED)) argument
327 static zend_always_inline uint32_t gc_compress(uint32_t idx) in gc_compress() argument
329 if (EXPECTED(idx < GC_MAX_UNCOMPRESSED)) { in gc_compress()
330 return idx; in gc_compress()
332 return (idx % GC_MAX_UNCOMPRESSED) | GC_MAX_UNCOMPRESSED; in gc_compress()
335 static zend_always_inline gc_root_buffer* gc_decompress(zend_refcounted *ref, uint32_t idx) in gc_decompress() argument
337 gc_root_buffer *root = GC_IDX2PTR(idx); in gc_decompress()
344 idx += GC_MAX_UNCOMPRESSED; in gc_decompress()
345 ZEND_ASSERT(idx < GC_G(first_unused)); in gc_decompress()
346 root = GC_IDX2PTR(idx); in gc_decompress()
355 uint32_t idx; in gc_fetch_unused() local
359 idx = GC_G(unused); in gc_fetch_unused()
360 root = GC_IDX2PTR(idx); in gc_fetch_unused()
363 return idx; in gc_fetch_unused()
374 uint32_t idx; in gc_fetch_next_unused() local
377 idx = GC_G(first_unused); in gc_fetch_next_unused()
379 return idx; in gc_fetch_next_unused()
585 uint32_t idx; in gc_possible_root_when_full() local
603 idx = GC_FETCH_UNUSED(); in gc_possible_root_when_full()
605 idx = GC_FETCH_NEXT_UNUSED(); in gc_possible_root_when_full()
611 idx = GC_FETCH_NEXT_UNUSED(); in gc_possible_root_when_full()
614 newRoot = GC_IDX2PTR(idx); in gc_possible_root_when_full()
618 idx = gc_compress(idx); in gc_possible_root_when_full()
619 GC_REF_SET_INFO(ref, idx | GC_PURPLE); in gc_possible_root_when_full()
629 uint32_t idx; in gc_possible_root() local
639 idx = GC_FETCH_UNUSED(); in gc_possible_root()
641 idx = GC_FETCH_NEXT_UNUSED(); in gc_possible_root()
650 newRoot = GC_IDX2PTR(idx); in gc_possible_root()
654 idx = gc_compress(idx); in gc_possible_root()
655 GC_REF_SET_INFO(ref, idx | GC_PURPLE); in gc_possible_root()
663 static zend_never_inline void ZEND_FASTCALL gc_remove_compressed(zend_refcounted *ref, uint32_t idx) in gc_remove_compressed() argument
665 gc_root_buffer *root = gc_decompress(ref, idx); in gc_remove_compressed()
672 uint32_t idx = GC_REF_ADDRESS(ref); in gc_remove_from_buffer() local
683 gc_remove_compressed(ref, idx); in gc_remove_from_buffer()
687 ZEND_ASSERT(idx); in gc_remove_from_buffer()
688 root = GC_IDX2PTR(idx); in gc_remove_from_buffer()
945 uint32_t idx; in gc_compact() local
959 idx = gc_compress(GC_PTR2IDX(free)); in gc_compact()
960 GC_REF_SET_INFO(p, idx | GC_REF_COLOR(p)); in gc_compact()
1146 uint32_t idx; in gc_add_garbage() local
1150 idx = GC_FETCH_UNUSED(); in gc_add_garbage()
1152 idx = GC_FETCH_NEXT_UNUSED(); in gc_add_garbage()
1158 idx = GC_FETCH_NEXT_UNUSED(); in gc_add_garbage()
1161 buf = GC_IDX2PTR(idx); in gc_add_garbage()
1164 idx = gc_compress(idx); in gc_add_garbage()
1165 GC_REF_SET_INFO(ref, idx | GC_BLACK); in gc_add_garbage()
1314 uint32_t idx, end; in gc_collect_roots() local
1335 idx = GC_FIRST_ROOT; in gc_collect_roots()
1337 while (idx != end) { in gc_collect_roots()
1338 current = GC_IDX2PTR(idx); in gc_collect_roots()
1346 idx++; in gc_collect_roots()
1487 uint32_t idx, end; in zend_gc_collect_cycles() local
1535 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1537 while (idx != end) { in zend_gc_collect_cycles()
1552 idx++; in zend_gc_collect_cycles()
1558 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1560 while (idx != end) { in zend_gc_collect_cycles()
1566 idx++; in zend_gc_collect_cycles()
1573 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1574 while (idx != end) { in zend_gc_collect_cycles()
1575 current = GC_IDX2PTR(idx); in zend_gc_collect_cycles()
1592 idx++; in zend_gc_collect_cycles()
1607 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1608 while (idx != end) { in zend_gc_collect_cycles()
1609 current = GC_IDX2PTR(idx); in zend_gc_collect_cycles()
1641 idx++; in zend_gc_collect_cycles()