Top
Best
New

Posted by khalidkhair 1 day ago

Why Windows 11 still ships with Windows 95's memory manager hidden inside it(www.windowslatest.com)
93 points | 56 commentspage 2
jeffbee 3 hours ago|
This is why memory allocators should be linked into applications and should not be considered operating system components.
GuB-42 1 hour ago||
If an OS update gives me a better allocator, I want every app to take advantage of it. Same idea with other libraries, if I update a library for reading zip files to make it go faster, or to fix a vulnerability, I want every application that uses that library to take advantage of it.

This is a debatable position. Linux distros usually do this, but a lot of modern applications ship with all their dependencies. I'd say the former is more efficient and generally better from a user perspective and the latter is more stable and is generally better from a developer/maintainer perspective. Open source encourages the former, proprietary software encourages the latter.

fredoralive 1 hour ago|||
How does the memory allocator statically linked into the application request a new memory allocation into it's address space (sbrk or VirtualAlloc etc.)? Allocating memory will in most cases involve calling into the kernel, it's kinda a core function of a kernel. It has to have some link externally to the programme, directly or indirectly.
pcwalton 3 hours ago|||
Userland system DLLs need to allocate memory too.
irishcoffee 2 hours ago||
Whenever I write I library I don't allocate memory. If memory needs to be allocated, the program calling into the library allocates memory and passes a pointer (or reference I suppose) into the library call.

Clearly this can't be enforced, but I've always found it bad practice to allocate memory inside a library.

rowls66 3 hours ago|||
And when you are running more than one application at the same time how is that supposed to work?
hyperhello 3 hours ago|||
It works fine. The processes get a fenced off piece of memory and are allowed to portion it out to themselves any way they prefer. Syscalls are designed to be mostly neutral about how the app wants to proceed.
hypercube33 27 minutes ago||||
Windows NT (NT - Windows 11) keeps applications in their own private memory space by design. Windows 1,2,3,95,98,Me didn't do this which is why it was more prone to blue screens.
jz391 6 minutes ago||
True, but this design decision (to include memory allocation API in the OS) predates the process separation/MMU.
bigfishrunning 3 hours ago|||
On a system with an MMU, applications have their own address space that the allocator draws from; pages need to be centrally allocated, but individual allocations can be handled in userspace
Spivak 1 hour ago||
In 20 years we'll have finally reached the logical conclusion to all of this that there shouldn't be separate os components you link against and your "OS" will just be manager of lightweight VMs.

Now you can just ship the user your machine and software can theoretically be immortal.

hyperhello 3 hours ago||
I don’t know much about CPU and memory back then, but did they not have some kind of memory access debugging mode where it would match every access against the alloc map, understanding that it could be very slow, but would find some of this kind of bug? Come to think of it, do we even have that today?
bboreham 2 hours ago||
There was such a tool, called Purify.

https://web.stanford.edu/class/cs343/resources/purify.pdf

vjvjvjvjghv 45 minutes ago||
Purify was great until Rational bought it and jacked up the price 10x.
jeffbee 3 hours ago||
This is what sanitizers do.
hyperhello 3 hours ago||
I know compilers have advanced, but I was wondering about a runtime debug check.
chuckadams 3 hours ago||
A sanitizer is that runtime debug check. The compiler just inserts those checks.
hyperhello 3 hours ago||
Okay. Then I have to assume that they didn't do it for SimCity! Thanks.
chuckadams 2 hours ago||
Sanitizers come with a lot of overhead, and the tech wasn't readily available in SimCity's day, certainly not for Windows 95.
hyperhello 2 hours ago||
I was imagining more like some kind of primitive CPU mode that sends every single RAM request to a software exception. Something you would normally have turned off but available for truly heavy duty debugging.
chuckadams 1 hour ago|||
That sounds pretty similar to what Valgrind does, basically runs your program in a VM with that kind of instrumentation. The details of how it works are way past the boundaries of my own knowledge though :)
thighbaugh 1 day ago||
What else could be expected of Redmond's finest?
Barrin92 2 hours ago||
are you implying the fact that they proactively threw in a custom heap manager for a game is supposed to be a bad thing? The fact that almost any 25+ year old executable runs on Windows to this day is fantastic, they're seemingly the only guys who take backwards compatibility seriously.
ForOldHack 3 hours ago||
A hidden z80 emulator...
xp84 1 hour ago|
This spirit is clearly a part of MS's corporate DNA and honestly I think the world is far better off for it. No other platform owner would do this, not today at least. The most you could expect from say, Apple or Google, is that they do ship the betas. If you go all summer without fixing "your" "bug" (note: it could be that the new OS is the code that introduced the bug) it'll just crash on OS launch day and the platform owner would make no attempt to even test it for you.

Maybe there's a tiny exception with like, Apple for Adobe. They might place a phone call between executives to warn them to avoid angering the "pros" who use those apps, but I think it's more because their users internally who also use Adobe apps would notice in the course of testing the betas, than a practice of testing many apps with the intent to ensure they work correctly.

To me what this feels like is that Microsoft's culture to this day considers it would be a breach of trust to ship an OS update that, from your perspective breaks your programs that used to work fine. Compared to the approach everywhere else today that the platform owner simply dictates How Things Will Be Now.