Remix.run Logo
WalterBright 3 days ago

The Zortech C/C++ compiler had another memory model: handle pointers. When dereferencing a handle pointer, the compiler emitted code that would swap in the necessary page from expanded memory, extended memory, or disk.

It works like a virtual memory system, except that the compiler emitted the necessary code rather than the CPU doing it in microcode.

https://www.digitalmars.com/ctg/handle-pointers.html

Similarly, Zortech C++ had the "VCM" memory model, which worked like virtual memory. Your code pages would be swapped in an out of memory as needed.

https://digitalmars.com/ctg/vcm.html

sitkack 3 days ago | parent | next [-]

That is sort of like inlining the demand paging code from the OS. When we have exokernels, they exist as a library so can be delt with like regular code

This would be trivial (and fun) to implement with Wasm.

actionfromafar 2 days ago | parent [-]

Are you saying this could be a way to break out of the 32 bit barrier (a bit) on WASM? Sort of like how Windows NT could handle 64 gigs of RAM even though it was a 32 bit operating system?

sitkack a day ago | parent [-]

Wasm64 will soon be everywhere if you want more than 4GB of address space. No, I was saying you could simulate larger heaps by selectively paging data memory in and out, you would still need a way to represent your max heap size.

Wasm also supports multimemories, https://github.com/WebAssembly/multi-memory

actionfromafar 14 hours ago | parent [-]

Interesting!

https://github.com/WebAssembly/multi-memory/blob/main/propos...

The scaling point is what I was thinking of.

"As long as Wasm memories are limited to 32 bit address space, there is no way to scale out of 4 GB memory efficiently. Multiple memories at least provide an efficient workaround until 64 bit memories become available (which may still take a while)."

So pretty similar to launching several processes on 32 bit NT or Linux, each having their own memory space.

jmclnx 2 days ago | parent | prev | next [-]

I was a user of Zortech C 1.0. I loved its disp_* functions.

One program (com) I wrote with it back then is still being used by at least one person. I talked to them a couple of months ago and they said they still use it.

WalterBright 2 days ago | parent [-]

Wow! good to know.

I used it for Empire, and for my text editor. When moving to Linux, it was easy to convert to using TTY sequences.

WalterBright 2 days ago | parent | prev [-]

Borland's "Zoom" scheme for overlays was well marketed, but not competitive with VCM (because only one overlay could be used at a time). That didn't matter, though, because Zoom was a catchy name and VCM was dull as dirt.

Phillipe Kahn is a marketing genius, and I am not.

(VCM's overlays could be loaded anywhere, the relocation happened at runtime.)