cerrseien.bsky.social
@cerrseien.bsky.social
undiagnosed but i'm pretty sure
It still doesn't beat the complete nonsense that is memory management on Linux, even if they're slowly improving - but at some point you've got to wonder if one of the largest software shops in the world doesn't get it right, that maybe this is all just pointless busywork.
April 25, 2025 at 4:48 AM
What are you talking about? It's great for everyone outside the US. Stuff that normally went to you now goes to the rest of the world, lowering prices there.

No, we actually feel pity that none of you got the balls to McKinley your problem.
April 4, 2025 at 5:27 AM
Probably on a four-poster bed.
April 4, 2025 at 5:07 AM
"32-bit"
That's what triggers me. I cannot fathom how many copies the thing does in the background.
April 4, 2025 at 3:58 AM
Just how high does he expect inflation to rise?!
April 4, 2025 at 3:54 AM
If there are workloads that absolutely need individual lifetimes I'd be happy to hear of them. Even the "gotta remove elements within an array" scenario can be countered with simple bitmasks that can be checked against -1 (for 64 elements).
April 4, 2025 at 3:29 AM
Goebbels called, even he thinks you're laying it on too thick.
April 4, 2025 at 1:58 AM
Wasn't there already problems with his arrest, i.e. the military simply not letting the police do it? What if the military is still loyal to him?
April 4, 2025 at 1:52 AM
Has he *seen* Putin when Prigozhin was doing his little march on Moscow?
April 4, 2025 at 1:10 AM
What happens if he simply ... doesn't?
April 4, 2025 at 1:02 AM
You're still assuming thought.
Cute.
April 3, 2025 at 11:44 PM
Guess you're no longer laughing, eh.
April 3, 2025 at 11:34 PM
I don't think this is what the administration meant when they claimed they were "colorblind".
April 3, 2025 at 11:31 PM
fopen calls CreateFileA at some point, which calls NtCreateFile at the end. The Nt calls on Windows (with only few exceptions) trap directly into the kernel. In between your call and the kernel is a waste of a million cycles (not counting the actual NtCreateFile call itself).
April 3, 2025 at 9:57 PM
Oh, it's backwards compatibility, that's all it is. CreateFileA/W are older than NtCreateFile. But discrete lifetimes have nothing to do with this; they simply needed a destination for a copy of the filename string that is prefixed by "\??\". Here's a Factorio trace that shows the problem via fopen:
April 3, 2025 at 9:51 PM
Where does it store that file name? Not on the stack. Where does it store the current directory string? Also not on the stack.
April 3, 2025 at 9:11 PM
In fact you can't even open a file on Windows without memory allocation, at least when you use the standard interfaces. NtCreateFile requires a namespace prefix ("\??\"), meaning that any interface that doesn't anticipate one will, at some point, have to create a copy of your file name with one.
April 3, 2025 at 9:10 PM
And how certain are you that these programs absolutely need individual lifetimes, not unified ones? That absolutely everything needs to be separated? Because that's not my experience.
April 3, 2025 at 9:08 PM
Even in that case you'd do good to avoid malloc, even if no reallocation happens at all. mmap/VirtualAlloc are guaranteed to provide page-aligned addresses (important for vector instruction sets), and writing over your allocated mapping triggers guard pages instead of juicy heap corruption.
April 3, 2025 at 9:06 PM
1. Well, I wasn't.
2. Which claim exactly? About what programs need? Have you ever traced applications - Windows, Linux, doesn't matter - and see them allocate and free memory blocks of the same size in quick succession? Windows does it all the time, in fact.
April 3, 2025 at 9:04 PM
In fact I also reject malloc's "general-purpose" attribute. It has a very specific purpose (provides individual lifetimes), for which lots of work and time has been dedicated. What most programs *need* isn't individual lifetimes, but memory allocation outside the limitations of a thread stack.
April 3, 2025 at 2:39 PM
"We could've had mreserve/mcommit for such purposes"
bsky.app/profile/cerr...

"could've had" is clearly conjunctive mood in response to "portable general-purpose memory allocation". malloc is portable by standard, mmap/VirtualAlloc aren't, mreserve/mcommit could've.
1. malloc <=> calloc.
2. Counterquestion: why do you assume malloc/calloc are the only way portability can be achieved? mmap/VirtualAlloc have very similar interfaces (if you ignore that mmap is also used for file mappings). We could've had mreserve/mcommit for such purposes ...
April 3, 2025 at 2:34 PM
And fifth: brk/sbrk in a multi-threaded environment is pain.
April 3, 2025 at 2:07 PM
Third, if you want to avoid mode switches caused by constantly faulting on pages that the kernel didn't map in (great design decision btw, Linux!), you can use MAP_POPULATE using mmap.
Fourth, one can overlay normal mappings with PROT_NONE ones to simulate Windows' reserve/commit semantics.
April 3, 2025 at 2:06 PM