1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types system-info kernel math namespaces
4 windows windows.kernel32 system-info.backend system ;
5 IN: system-info.windows.ce
7 : memory-status ( -- MEMORYSTATUS )
8 "MEMORYSTATUS" <c-object>
9 "MEMORYSTATUS" heap-size over set-MEMORYSTATUS-dwLength
10 dup GlobalMemoryStatus ;
12 M: wince cpus ( -- n ) 1 ;
14 M: wince memory-load ( -- n )
15 memory-status MEMORYSTATUS-dwMemoryLoad ;
17 M: wince physical-mem ( -- n )
18 memory-status MEMORYSTATUS-dwTotalPhys ;
20 M: wince available-mem ( -- n )
21 memory-status MEMORYSTATUS-dwAvailPhys ;
23 M: wince total-page-file ( -- n )
24 memory-status MEMORYSTATUS-dwTotalPageFile ;
26 M: wince available-page-file ( -- n )
27 memory-status MEMORYSTATUS-dwAvailPageFile ;
29 M: wince total-virtual-mem ( -- n )
30 memory-status MEMORYSTATUS-dwTotalVirtual ;
32 M: wince available-virtual-mem ( -- n )
33 memory-status MEMORYSTATUS-dwAvailVirtual ;