Lines Matching refs:GC_G
165 #define GC_IDX2PTR(idx) (GC_G(buf) + (idx))
166 #define GC_PTR2IDX(ptr) ((ptr) - GC_G(buf))
191 (GC_G(unused) != GC_INVALID)
198 (GC_G(first_unused) < GC_G(gc_threshold))
200 (GC_G(first_unused) != GC_G(buf_size))
240 #define GC_G(v) ZEND_TSRMG_FAST(gc_globals_offset, zend_gc_globals *, v) macro
242 #define GC_G(v) (gc_globals.v) macro
247 # define GC_BENCH_INC(counter) GC_G(counter)++
248 # define GC_BENCH_DEC(counter) GC_G(counter)--
250 if (GC_G(counter) > GC_G(peak)) { \
251 GC_G(peak) = GC_G(counter); \
345 ZEND_ASSERT(idx < GC_G(first_unused)); in gc_decompress()
359 idx = GC_G(unused); in gc_fetch_unused()
362 GC_G(unused) = GC_LIST2IDX(root->ref); in gc_fetch_unused()
368 root->ref = GC_IDX2LIST(GC_G(unused)); in gc_link_unused()
369 GC_G(unused) = GC_PTR2IDX(root); in gc_link_unused()
377 idx = GC_G(first_unused); in gc_fetch_next_unused()
378 GC_G(first_unused) = GC_G(first_unused) + 1; in gc_fetch_next_unused()
418 GC_G(num_roots)--; in gc_remove_from_roots()
475 if (GC_G(buf)) { in gc_reset()
476 GC_G(gc_active) = 0; in gc_reset()
477 GC_G(gc_protected) = 0; in gc_reset()
478 GC_G(gc_full) = 0; in gc_reset()
479 GC_G(unused) = GC_INVALID; in gc_reset()
480 GC_G(first_unused) = GC_FIRST_ROOT; in gc_reset()
481 GC_G(num_roots) = 0; in gc_reset()
483 GC_G(gc_runs) = 0; in gc_reset()
484 GC_G(collected) = 0; in gc_reset()
487 GC_G(root_buf_length) = 0; in gc_reset()
488 GC_G(root_buf_peak) = 0; in gc_reset()
489 GC_G(zval_possible_root) = 0; in gc_reset()
490 GC_G(zval_buffered) = 0; in gc_reset()
491 GC_G(zval_remove_from_buffer) = 0; in gc_reset()
492 GC_G(zval_marked_grey) = 0; in gc_reset()
499 bool old_enabled = GC_G(gc_enabled); in gc_enable()
500 GC_G(gc_enabled) = enable; in gc_enable()
501 if (enable && !old_enabled && GC_G(buf) == NULL) { in gc_enable()
502 GC_G(buf) = (gc_root_buffer*) pemalloc(sizeof(gc_root_buffer) * GC_DEFAULT_BUF_SIZE, 1); in gc_enable()
503 GC_G(buf)[0].ref = NULL; in gc_enable()
504 GC_G(buf_size) = GC_DEFAULT_BUF_SIZE; in gc_enable()
505 GC_G(gc_threshold) = GC_THRESHOLD_DEFAULT; in gc_enable()
513 return GC_G(gc_enabled); in gc_enabled()
518 bool old_protected = GC_G(gc_protected); in gc_protect()
519 GC_G(gc_protected) = protect; in gc_protect()
525 return GC_G(gc_protected); in gc_protected()
532 if (GC_G(buf_size) >= GC_MAX_BUF_SIZE) { in gc_grow_root_buffer()
533 if (!GC_G(gc_full)) { in gc_grow_root_buffer()
535 GC_G(gc_active) = 1; in gc_grow_root_buffer()
536 GC_G(gc_protected) = 1; in gc_grow_root_buffer()
537 GC_G(gc_full) = 1; in gc_grow_root_buffer()
541 if (GC_G(buf_size) < GC_BUF_GROW_STEP) { in gc_grow_root_buffer()
542 new_size = GC_G(buf_size) * 2; in gc_grow_root_buffer()
544 new_size = GC_G(buf_size) + GC_BUF_GROW_STEP; in gc_grow_root_buffer()
549 GC_G(buf) = perealloc(GC_G(buf), sizeof(gc_root_buffer) * new_size, 1); in gc_grow_root_buffer()
550 GC_G(buf_size) = new_size; in gc_grow_root_buffer()
562 if (GC_G(gc_threshold) < GC_THRESHOLD_MAX) { in gc_adjust_threshold()
563 new_threshold = GC_G(gc_threshold) + GC_THRESHOLD_STEP; in gc_adjust_threshold()
567 if (new_threshold > GC_G(buf_size)) { in gc_adjust_threshold()
570 if (new_threshold <= GC_G(buf_size)) { in gc_adjust_threshold()
571 GC_G(gc_threshold) = new_threshold; in gc_adjust_threshold()
574 } else if (GC_G(gc_threshold) > GC_THRESHOLD_DEFAULT) { in gc_adjust_threshold()
575 new_threshold = GC_G(gc_threshold) - GC_THRESHOLD_STEP; in gc_adjust_threshold()
579 GC_G(gc_threshold) = new_threshold; in gc_adjust_threshold()
591 if (GC_G(gc_enabled) && !GC_G(gc_active)) { in gc_possible_root_when_full()
620 GC_G(num_roots)++; in gc_possible_root_when_full()
632 if (UNEXPECTED(GC_G(gc_protected))) { in gc_possible_root()
656 GC_G(num_roots)++; in gc_possible_root()
682 if (UNEXPECTED(GC_G(first_unused) >= GC_MAX_UNCOMPRESSED)) { in gc_remove_from_buffer()
939 if (GC_G(num_roots) + GC_FIRST_ROOT != GC_G(first_unused)) { in gc_compact()
940 if (GC_G(num_roots)) { in gc_compact()
942 gc_root_buffer *scan = GC_IDX2PTR(GC_G(first_unused) - 1); in gc_compact()
943 gc_root_buffer *end = GC_IDX2PTR(GC_G(num_roots)); in gc_compact()
968 GC_G(unused) = GC_INVALID; in gc_compact()
969 GC_G(first_unused) = GC_G(num_roots) + GC_FIRST_ROOT; in gc_compact()
980 last = GC_IDX2PTR(GC_G(first_unused)); in gc_mark_roots()
1111 gc_root_buffer *last = GC_IDX2PTR(GC_G(first_unused)); in gc_scan_roots()
1146 GC_G(num_roots)++; in gc_add_garbage()
1295 gc_root_buffer *last = GC_IDX2PTR(GC_G(first_unused)); in gc_collect_roots()
1313 end = GC_G(first_unused); in gc_collect_roots()
1447 if (GC_G(num_roots)) { in zend_gc_collect_cycles()
1458 if (GC_G(gc_active)) { in zend_gc_collect_cycles()
1463 GC_G(gc_runs)++; in zend_gc_collect_cycles()
1464 GC_G(gc_active) = 1; in zend_gc_collect_cycles()
1474 if (!GC_G(num_roots)) { in zend_gc_collect_cycles()
1478 GC_G(gc_active) = 0; in zend_gc_collect_cycles()
1484 end = GC_G(first_unused); in zend_gc_collect_cycles()
1560 if (GC_G(gc_protected)) { in zend_gc_collect_cycles()
1616 GC_G(num_roots)--; in zend_gc_collect_cycles()
1625 GC_G(collected) += count; in zend_gc_collect_cycles()
1627 GC_G(gc_active) = 0; in zend_gc_collect_cycles()
1648 status->runs = GC_G(gc_runs); in zend_gc_get_status()
1649 status->collected = GC_G(collected); in zend_gc_get_status()
1650 status->threshold = GC_G(gc_threshold); in zend_gc_get_status()
1651 status->num_roots = GC_G(num_roots); in zend_gc_get_status()