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()
944 uint32_t idx; in gc_compact() local
958 idx = gc_compress(GC_PTR2IDX(free)); in gc_compact()
959 GC_REF_SET_INFO(p, idx | GC_REF_COLOR(p)); in gc_compact()
1126 uint32_t idx; in gc_add_garbage() local
1130 idx = GC_FETCH_UNUSED(); in gc_add_garbage()
1132 idx = GC_FETCH_NEXT_UNUSED(); in gc_add_garbage()
1138 idx = GC_FETCH_NEXT_UNUSED(); in gc_add_garbage()
1141 buf = GC_IDX2PTR(idx); in gc_add_garbage()
1144 idx = gc_compress(idx); in gc_add_garbage()
1145 GC_REF_SET_INFO(ref, idx | GC_BLACK); in gc_add_garbage()
1291 uint32_t idx, end; in gc_collect_roots() local
1312 idx = GC_FIRST_ROOT; in gc_collect_roots()
1314 while (idx != end) { in gc_collect_roots()
1315 current = GC_IDX2PTR(idx); in gc_collect_roots()
1323 idx++; in gc_collect_roots()
1452 uint32_t idx, end; in zend_gc_collect_cycles() local
1500 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1502 while (idx != end) { in zend_gc_collect_cycles()
1517 idx++; in zend_gc_collect_cycles()
1523 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1525 while (idx != end) { in zend_gc_collect_cycles()
1531 idx++; in zend_gc_collect_cycles()
1538 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1539 while (idx != end) { in zend_gc_collect_cycles()
1540 current = GC_IDX2PTR(idx); in zend_gc_collect_cycles()
1557 idx++; in zend_gc_collect_cycles()
1572 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1573 while (idx != end) { in zend_gc_collect_cycles()
1574 current = GC_IDX2PTR(idx); in zend_gc_collect_cycles()
1606 idx++; in zend_gc_collect_cycles()