Merge 'minor-next' into 'major-next'

Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/12423751811
This commit is contained in:
pmmp-admin-bot[bot] 2024-12-20 01:24:32 +00:00
commit 47a1aa6470

View File

@ -38,7 +38,7 @@ use raklib\server\ServerSocket;
use raklib\server\SimpleProtocolAcceptor;
use raklib\utils\ExceptionTraceCleaner;
use raklib\utils\InternetAddress;
use function gc_enable;
use function gc_disable;
use function ini_set;
class RakLibServer extends Thread{
@ -82,10 +82,9 @@ class RakLibServer extends Thread{
}
protected function onRun() : void{
//TODO: switch to manually triggered GC
//the best time to do it is between ticks when the server would otherwise be sleeping, but RakLib's current
//design doesn't allow this as of 1.1.1
gc_enable();
//RakLib has cycles (e.g. ServerSession <-> Server) but these cycles are explicitly cleaned up anyway, and are
//very few, so it's pointless to waste CPU time on GC
gc_disable();
ini_set("display_errors", '1');
ini_set("display_startup_errors", '1');