Lines Matching refs:idx
164 #define GC_IDX2PTR(idx) (GC_G(buf) + (idx)) argument
167 #define GC_IDX2LIST(idx) ((void*)(uintptr_t)(((idx) * sizeof(void*)) | GC_UNUSED)) argument
326 static zend_always_inline uint32_t gc_compress(uint32_t idx) in gc_compress() argument
328 if (EXPECTED(idx < GC_MAX_UNCOMPRESSED)) { in gc_compress()
329 return idx; in gc_compress()
331 return (idx % GC_MAX_UNCOMPRESSED) | GC_MAX_UNCOMPRESSED; in gc_compress()
334 static zend_always_inline gc_root_buffer* gc_decompress(zend_refcounted *ref, uint32_t idx) in gc_decompress() argument
336 gc_root_buffer *root = GC_IDX2PTR(idx); in gc_decompress()
343 idx += GC_MAX_UNCOMPRESSED; in gc_decompress()
344 ZEND_ASSERT(idx < GC_G(first_unused)); in gc_decompress()
345 root = GC_IDX2PTR(idx); in gc_decompress()
354 uint32_t idx; in gc_fetch_unused() local
358 idx = GC_G(unused); in gc_fetch_unused()
359 root = GC_IDX2PTR(idx); in gc_fetch_unused()
362 return idx; in gc_fetch_unused()
373 uint32_t idx; in gc_fetch_next_unused() local
376 idx = GC_G(first_unused); in gc_fetch_next_unused()
378 return idx; in gc_fetch_next_unused()
584 uint32_t idx; in gc_possible_root_when_full() local
602 idx = GC_FETCH_UNUSED(); in gc_possible_root_when_full()
604 idx = GC_FETCH_NEXT_UNUSED(); in gc_possible_root_when_full()
610 idx = GC_FETCH_NEXT_UNUSED(); in gc_possible_root_when_full()
613 newRoot = GC_IDX2PTR(idx); in gc_possible_root_when_full()
617 idx = gc_compress(idx); in gc_possible_root_when_full()
618 GC_REF_SET_INFO(ref, idx | GC_PURPLE); in gc_possible_root_when_full()
628 uint32_t idx; in gc_possible_root() local
638 idx = GC_FETCH_UNUSED(); in gc_possible_root()
640 idx = GC_FETCH_NEXT_UNUSED(); in gc_possible_root()
649 newRoot = GC_IDX2PTR(idx); in gc_possible_root()
653 idx = gc_compress(idx); in gc_possible_root()
654 GC_REF_SET_INFO(ref, idx | GC_PURPLE); in gc_possible_root()
662 static zend_never_inline void ZEND_FASTCALL gc_remove_compressed(zend_refcounted *ref, uint32_t idx) in gc_remove_compressed() argument
664 gc_root_buffer *root = gc_decompress(ref, idx); in gc_remove_compressed()
671 uint32_t idx = GC_REF_ADDRESS(ref); in gc_remove_from_buffer() local
682 gc_remove_compressed(ref, idx); in gc_remove_from_buffer()
686 ZEND_ASSERT(idx); in gc_remove_from_buffer()
687 root = GC_IDX2PTR(idx); in gc_remove_from_buffer()
938 uint32_t idx; in gc_compact() local
952 idx = gc_compress(GC_PTR2IDX(free)); in gc_compact()
953 GC_REF_SET_INFO(p, idx | GC_REF_COLOR(p)); in gc_compact()
1134 uint32_t idx; in gc_add_garbage() local
1138 idx = GC_FETCH_UNUSED(); in gc_add_garbage()
1140 idx = GC_FETCH_NEXT_UNUSED(); in gc_add_garbage()
1146 idx = GC_FETCH_NEXT_UNUSED(); in gc_add_garbage()
1149 buf = GC_IDX2PTR(idx); in gc_add_garbage()
1152 idx = gc_compress(idx); in gc_add_garbage()
1153 GC_REF_SET_INFO(ref, idx | GC_BLACK); in gc_add_garbage()
1293 uint32_t idx, end; in gc_collect_roots() local
1314 idx = GC_FIRST_ROOT; in gc_collect_roots()
1316 while (idx != end) { in gc_collect_roots()
1317 current = GC_IDX2PTR(idx); in gc_collect_roots()
1325 idx++; in gc_collect_roots()
1449 uint32_t idx, end; in zend_gc_collect_cycles() local
1496 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1498 while (idx != end) { in zend_gc_collect_cycles()
1513 idx++; in zend_gc_collect_cycles()
1519 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1521 while (idx != end) { in zend_gc_collect_cycles()
1527 idx++; in zend_gc_collect_cycles()
1534 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1535 while (idx != end) { in zend_gc_collect_cycles()
1536 current = GC_IDX2PTR(idx); in zend_gc_collect_cycles()
1553 idx++; in zend_gc_collect_cycles()
1567 idx = GC_FIRST_ROOT; in zend_gc_collect_cycles()
1568 while (idx != end) { in zend_gc_collect_cycles()
1569 current = GC_IDX2PTR(idx); in zend_gc_collect_cycles()
1601 idx++; in zend_gc_collect_cycles()