You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// => read the file in the fixed buffer, search to after the `)` to skip the variable name part, then scan till the `129` RSS value, and then convert it from pages to bytes.
14
+
mutf:= os.open_file('/proc/self/stat', 'r')!
15
+
defer { f.close() }
16
+
read:= f.read_into_ptr(pc, buffer.len)!
17
+
if read <=0 {
18
+
returnerror('could not read from /proc/self/stat')
19
+
}
20
+
mutc:=0
21
+
unsafe {
22
+
// scan to after the process name (`comm`) field:
23
+
for c < buffer.len &&*pc !=`)` {
24
+
pc++
25
+
c++
26
+
}
27
+
mutspaces:=0
28
+
// the following fields, are space separated numbers, skip past them to the `rss` field:
0 commit comments