Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Zend/zend_builtin_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,14 @@ ZEND_FUNCTION(gc_mem_caches)
Returns number of freed zvals */
ZEND_FUNCTION(gc_collect_cycles)
{
ZEND_PARSE_PARAMETERS_NONE();
bool full_gc = true;

ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(full_gc);
ZEND_PARSE_PARAMETERS_END();

RETURN_LONG(gc_collect_cycles());
RETURN_LONG(gc_collect_cycles(full_gc));
}
/* }}} */

Expand Down Expand Up @@ -231,6 +236,9 @@ ZEND_FUNCTION(gc_status)
add_assoc_double_ex(return_value, "collector_time", sizeof("collector_time")-1, (double) status.collector_time / ZEND_NANO_IN_SEC);
add_assoc_double_ex(return_value, "destructor_time", sizeof("destructor_time")-1, (double) status.dtor_time / ZEND_NANO_IN_SEC);
add_assoc_double_ex(return_value, "free_time", sizeof("free_time")-1, (double) status.free_time / ZEND_NANO_IN_SEC);
add_assoc_double_ex(return_value, "mark_roots_time", sizeof("mark_roots_time")-1, (double) status.mark_roots_time / ZEND_NANO_IN_SEC);
add_assoc_double_ex(return_value, "scan_roots_time", sizeof("scan_roots_time")-1, (double) status.scan_roots_time / ZEND_NANO_IN_SEC);
add_assoc_double_ex(return_value, "collect_roots_time", sizeof("collect_roots_time")-1, (double) status.collect_roots_time / ZEND_NANO_IN_SEC);
}
/* }}} */

Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_builtin_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function zend_thread_id(): int {}

function gc_mem_caches(): int {}

function gc_collect_cycles(): int {}
function gc_collect_cycles(bool $full_gc = true): int {}

function gc_enabled(): bool {}

Expand Down
6 changes: 4 additions & 2 deletions Zend/zend_builtin_functions_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Zend/zend_execute_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ ZEND_API void zend_shutdown_executor_values(bool fast_shutdown)

#if ZEND_DEBUG
if (!CG(unclean_shutdown)) {
gc_collect_cycles();
gc_collect_cycles(true);
}
#endif
} else {
Expand Down
Loading
Loading