3 ms·
Perhaps I was unclear (or I'm confused now, haha): > The following is the tiny demo of the runtime code generation and execution in Go. I assume you are on a U
by metadat 2y ago
Perhaps I was unclear (or I'm confused now, haha):
> The following is the tiny demo of the runtime code generation and execution in Go. I assume you are on a Unix-like system like Linux or macOS on an AArch64 machine.
Is there a way to get tinydemo working on Windows?
- ncruces 2y agoOh, OK. You need to replace calls to syscall.Mmap with windows.VirtualAlloc [1], syscall.Mprotect with windows.VirtualProtect, etc. You don't even need to change the ASM preamble. [1]: https://pkg.go.dev/golang.org/x/sys/windows#VirtualAlloc https://pkg.go.dev/golang.org/x/sys/windows#VirtualAlloc
- evacchi 2y agoand for reference see how it's done in wazero https://github.com/tetratelabs/wazero/blob/c397a402ad17e495a5a22fef709a1d4abef1f3ce/internal/platform/mmap_windows.go https://github.com/tetratelabs/wazero/blob/c397a402ad17e495a...