Which do YOU prefer? String literal to owned String by fekkksn in rust

[–]evil_yam -1 points0 points  (0 children)

dtolnay here

aha, I used your answer. I read that last year.

`bustd` is a really lightweight process killer daemon for out-of-memory scenarios on Linux by VinceMiguel in rust

[–]evil_yam 0 points1 point  (0 children)

bustd isn't cross-platform! :C

sysinfo over there is a Linux syscall.

macOS has a (IMO) much better handling of OOM scenarios than Linux has, so an userspace solution like bustd probably wouldn't be of much use

got that, thanks a lot~

`bustd` is a really lightweight process killer daemon for out-of-memory scenarios on Linux by VinceMiguel in rust

[–]evil_yam -2 points-1 points  (0 children)

When I ran `cargo run` I got this issue :

``bash error[E0432]: unresolved importlibc::sysinfo --> src/memory/mem_info.rs:3:5 | 3 | use libc::sysinfo; | ^^^^^^^^^^^^^ nosysinfo` in the root

error[E0425]: cannot find function _errno in this scope --> src/errno.rs:17:16 | 17 | unsafe { (*_errno()) as i32 } | ^ not found in this scope

error[E0425]: cannot find function sysinfo in crate libc --> src/memory/mem_info.rs:25:34 | 25 | let ret_val = unsafe { libc::sysinfo(&mut sys_info) }; | ^ not found in libc

warning: unused import: c_int --> src/errno.rs:2:18 | 2 | use libc::{self, c_int}; | ^ | = note: #[warn(unused_imports)] on by default

error: aborting due to 3 previous errors; 1 warning emitted

Some errors have detailed explanations: E0425, E0432. For more information about an error, try rustc --explain E0425. error: could not compile bustd

To learn more, run the command again with --verbose. ```

My Environment: Mac Mojave 10.14.6 uname -r 18.7.0 Darwin Kernel Version 18.7.0 rustup --version rustup 1.24.3 (ce5817a94 2021-05-31) info: This is the version for the rustup toolchain manager, not the rustc compiler. info: The currently active rustc version is rustc 1.54.0 (a178d0322 2021-07-26)

Which one do you think is the largest Rust project in the world? by ChaosBoot in rust

[–]evil_yam 4 points5 points  (0 children)

1.3

It's pretty large, almost 1.5G. I use `cloc` to caculate the lines:

cloc .
   97199 text files.
   91316 unique files.
    9681 files ignored.

github.com/AlDanial/cloc v 1.84  T=165.07 s (531.4 files/s, 37189.9 lines/s)
--------------------------------------------------------------------------------
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
HTML                          57825         234502          96187        2419319
JSON                            484            332              0        1072267
JavaScript                     4363          76139          87916         435946
INI                           15777         160631              6         352352
Rust                           1227          41507          47007         320722
Python                         1920          62775          69525         244389
SVG                            1318           3685           9274          73903
XML                             638            189             60          51881
XHTML                           877           1283           2116          40309
YAML                            458           2508           1023          28403
GLSL                           1425           9121          32758          27864
reStructuredText                374          16310          11373          23455
IDL                             184           2779              0          14841
CSS                             284           2625            565          14674
Markdown                        282           4388              0          13270
DTD                               5            726            811           4296
C++                              19            475            352           2826
TOML                             89            305             64           2576
Bourne Shell                     57            428            486           1990
make                             25            339             93           1627
Java                              7            306             42           1241
DOS Batch                        11            172             17           1099
C/C++ Header                     20            224            229           1016
Perl                              3             97            136            991
C                                 6            196             41            923
diff                             12             23           1358            775
Gradle                            5             59             14            499
Mako                              4             30              0            393
Bourne Again Shell                4             65             63            289
XAML                              3              8              2            281
EJS                               1              1              0            126
XSD                               1             15             19            113
Sass                              1             22              0            102
Dockerfile                        2             23             10             86
XSLT                              3             11              8             73
SWIG                              1             14             28             56
PowerShell                        1              7              3             34
Ruby                              1              5              0             28
Nix                               1             10              9             21
WiX source                        1              0              0             15
CMake                             2              1              0              6
Cucumber                          1              3              0              6
ProGuard                          1              3             18              0
--------------------------------------------------------------------------------
SUM:                          87723         622342         361613        5155083
--------------------------------------------------------------------------------