: hyperthreads ( -- n ) parse-proc-cpuinfo sort-cpus cpu-counts 2nip ;
M: linux cpu-mhz parse-proc-cpuinfo first cpu-mhz>> 1,000,000 * ;
M: linux physical-mem parse-proc-meminfo mem-total>> ;
+M: linux computer-name nodename ;
\ No newline at end of file
: tb-frequency ( -- n ) { 6 23 } sysctl-query-uint ;
M: macosx physical-mem ( -- n ) { 6 24 } sysctl-query-ulonglong ;
: available-cpus ( -- n ) { 6 25 } sysctl-query-uint ;
+
+M: macosx computer-name { 1 10 } sysctl-query-string "." split1 drop ;
HOOK: total-virtual-mem os ( -- n )
HOOK: available-virtual-mem os ( -- n )
HOOK: available-virtual-extended-mem os ( -- n )
+HOOK: computer-name os ( -- string )
: write-unit ( x n str -- )
[ 2^ /f number>string write bl ] [ write ] bi* ;
M: windows available-virtual-mem ( -- n )
memory-status ullAvailVirtual>> ;
-: computer-name ( -- string )
+M: windows computer-name ( -- string )
MAX_COMPUTERNAME_LENGTH 1 +
[ <byte-array> dup ] keep uint <ref>
GetComputerName win32-error=0/f alien>native-string ;