Food, environment, snark 

Food, environment, snark 

Food, environment, snark 

Food, environment, snark 

Food, environment, snark 

Just found some interesting code in jemalloc's implementation of a mutex:

if (ncpus == 1) {
goto label_spin_done;
}

github.com/jemalloc/jemalloc/b

@alva Compare and Swap in a loop would have the same result I guess. Although with quite a difference of what happens behind the covers.

@alva Sounds like "Living on my own" by Freddie Mercury.

But it's definitely strange that this happens in language. Essentially increasing the "no" by saying it twice instead of negating it like boolean algebra.

@alva 🤔 seems you are correct. I definitely have code without including the New header anywhere but using placement new. But I think the header is probably included transitively via some other standard header.

Every day you learb something new.

@alva Yeah Rust is a tool that you can use to make things fast, but it's up to the programmer to use it that way.

But to be fair, if you solve the same problem both in idiomatic Rust and Python without particularly optimising anything, it is not unlikely that the Rust code runs faster and with less memory. (but also that writing it took longer)

@alva And writing a C++ API for a C++ Library is utterly impossible. There are so many choices to make and all of them are wrong.

@alva I'm struggling with similar thoughts. It's not that I want to grow it forever, but I definitely prefer it long, but this heat is seriously making me consider cutting it right off.

Linux, testing 

Being a security buffoon, advice welcome 

Being a security buffoon, advice welcome 

Show more
mastodon.cloud

Generalistic and moderated instance.