1. 8
    Setting a wallpaper with less than 250 Kb performance rust lgfae.com
  1.  

    1. ~
      #[unsafe(no_mangle)]
      pub extern "C" fn main(
          argc: core::ffi::c_long,
          argv: *const *const core::ffi::c_char,
      ) -> core::ffi::c_long {
      

      Shouldn't the core::ffi::c_longs be core::ffi::c_int instead?

      1. ~

        You're right, but in practice it won't make much of a difference with regard to the ABI, as both long and int fit in a single register on (almost all?) architectures that Linux and the BSDs support, so are going to be passed/returned in the same way. (EDIT: on 32-bit x86, both long and/int are 32-bits so argc will be passed on the stack; on 64-bit x86, it'll be passed in the edi/rdi register. On ARM both 32-bit and 64-bit, it'll be passed in r0 or x0 respectively; for the return values, all arches listed here will pass int/long using the same register, eax/rax on x86, and r0/x0 on ARM).

        There might be some edge cases with regard to sign extension, but I can't think of how they would actually occur right now.

      2. ~

        Pretty cool, but e.g. libc will very likely stay in memory regardless of whether it counts toward the RSS of this tool or not.

        1. ~

          Both this article and the linked one about german-style strings are pretty interesting