mirror of
https://github.com/pithings/unkernel.git
synced 2026-12-02 09:09:46 +08:00
An SMP kernel imports a shared memory, which the JS API does not show. boot() assumed an unshared one, allocated it, got a LinkError and allocated again, shared. It now guesses the sharing from the atomics feature in the module's target_features section, as moduleIsMemory64() does for the memory type; the retry stays for a wrong guess (a module with atomics on an unshared memory). memoryFallbackMiB only applied to the unshared allocation: where the shared one then failed, boot was rejected with the LinkError and no fallback was tried. It now applies to the shared allocation. Co-authored-by: Pooya Parsa <pooya@pi0.io>