Login
You're viewing the functional.cafe public feed.

Replies

  • Nov 11, 2026, 4:08 PM

    @xentrac DLLs can get evicted while still active -- i.e. their page can get borrowed -- but the borrow mechanism restores them on return. All returns get routed through the DLL manager which reloads whatever got borrowed. An active DLL can only be evicted during a call to a later DLL in the chain, so it’s safe and the evicted caller won’t know that it happened.

    💬 1🔄 1⭐ 0
  • 💬 1🔄 0⭐ 0
  • Nov 12, 2026, 4:40 AM

    @xentrac Inter-DLL calls. Calls within the DLL are handled by self-modification of the JSR target's high byte. (We know the low byte at assemble time.)

    💬 1🔄 0⭐ 0
  • Nov 12, 2026, 4:47 AM

    @a2_4am I see! So comparatively rare inter-DLL calls experience some overhead, but you don't need to do the kind of stack scanning at eviction time that Windows 3 did. Do you have a ballpark for how much time the inter-DLL trampoline takes in your programs? 5%, 0.5%, 0.05%? Does the system support storing function pointers for inter-DLL calls in data structures?

    💬 1🔄 0⭐ 0
  • Nov 13, 2026, 2:07 PM

    @xentrac I don't think we've measured that yet, but we've minimized overhead where we can. For example if we didn't need to borrow a page in order to load the DLL, we self-modify the return trampoline to an RTS, and the DLL stays cached until evicted. So it squashes down nicely in the optimal case. We do not support storing function pointers outside the DLL code itself. Cache invalidation is already hard enough!

    💬 1🔄 0⭐ 0
  • Nov 13, 2026, 2:28 PM

    @a2_4am Cache invalidation is famously one of the two unsolved problems of computer science!

    I don't think I understand the RTS case you're describing. I had assumed that RTS would be how far-called exported subroutines normally transfer control back to the return trampoline, whose entry point would have been pushed onto the return stack during the far-call process. But it sounds like that isn't the mechanism?

    💬 0🔄 0⭐ 0