mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 00:25:04 +00:00
Replace disallowed operators in src/utils/
This commit is contained in:
@ -56,7 +56,7 @@ final class Process{
|
||||
$reserved = memory_get_usage();
|
||||
$VmSize = null;
|
||||
$VmRSS = null;
|
||||
if(Utils::getOS() === Utils::OS_LINUX or Utils::getOS() === Utils::OS_ANDROID){
|
||||
if(Utils::getOS() === Utils::OS_LINUX || Utils::getOS() === Utils::OS_ANDROID){
|
||||
$status = @file_get_contents("/proc/self/status");
|
||||
if($status === false) throw new AssumptionFailedError("/proc/self/status should always be accessible");
|
||||
|
||||
@ -94,7 +94,7 @@ final class Process{
|
||||
$stack = 0;
|
||||
$heap = 0;
|
||||
|
||||
if(Utils::getOS() === Utils::OS_LINUX or Utils::getOS() === Utils::OS_ANDROID){
|
||||
if(Utils::getOS() === Utils::OS_LINUX || Utils::getOS() === Utils::OS_ANDROID){
|
||||
$mappings = @file("/proc/self/maps");
|
||||
if($mappings === false) throw new AssumptionFailedError("/proc/self/maps should always be accessible");
|
||||
foreach($mappings as $line){
|
||||
@ -112,7 +112,7 @@ final class Process{
|
||||
}
|
||||
|
||||
public static function getThreadCount() : int{
|
||||
if(Utils::getOS() === Utils::OS_LINUX or Utils::getOS() === Utils::OS_ANDROID){
|
||||
if(Utils::getOS() === Utils::OS_LINUX || Utils::getOS() === Utils::OS_ANDROID){
|
||||
$status = @file_get_contents("/proc/self/status");
|
||||
if($status === false) throw new AssumptionFailedError("/proc/self/status should always be accessible");
|
||||
if(preg_match("/Threads:[ \t]+([0-9]+)/", $status, $matches) > 0){
|
||||
|
Reference in New Issue
Block a user