| ... | ... | @@ -1204,3 +1204,16 @@ fn totalSystemMemoryLinux() !usize { |
| 1204 | 1204 | const kilobytes = try std.fmt.parseInt(usize, int_text, 10); |
| 1205 | 1205 | return kilobytes * 1024; |
| 1206 | 1206 | } |
| 1207 | |
| 1208 | /// Indicate that we are now terminating with a successful exit code. |
| 1209 | /// In debug builds, this is a no-op, so that the calling code's |
| 1210 | /// cleanup mechanisms are tested and so that external tools that |
| 1211 | /// check for resource leaks can be accurate. In release builds, this |
| 1212 | /// calls exit(0), and does not return. |
| 1213 | pub fn cleanExit() void { |
| 1214 | if (builtin.mode == .Debug) { |
| 1215 | return; |
| 1216 | } else { |
| 1217 | exit(0); |
| 1218 | } |
| 1219 | } |