diff options
author | 2025-03-09 17:47:56 +0100 | |
---|---|---|
committer | 2025-03-10 01:59:49 +0100 | |
commit | 3ac1ee16f377d31a0fb80c8dae28b6239ac4229e (patch) | |
tree | f61faa581feaaeaba2542b9f2b8234a590684413 /vendor/github.com/tetratelabs/wazero/internal/platform/platform.go | |
parent | [chore] update URLs to forked source (diff) | |
download | gotosocial-3ac1ee16f377d31a0fb80c8dae28b6239ac4229e.tar.xz |
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/tetratelabs/wazero/internal/platform/platform.go')
-rw-r--r-- | vendor/github.com/tetratelabs/wazero/internal/platform/platform.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/platform.go b/vendor/github.com/tetratelabs/wazero/internal/platform/platform.go deleted file mode 100644 index b9af094c1..000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/platform.go +++ /dev/null @@ -1,46 +0,0 @@ -// Package platform includes runtime-specific code needed for the compiler or otherwise. -// -// Note: This is a dependency-free alternative to depending on parts of Go's x/sys. -// See /RATIONALE.md for more context. -package platform - -import ( - "runtime" -) - -// archRequirementsVerified is set by platform-specific init to true if the platform is supported -var archRequirementsVerified bool - -// CompilerSupported includes constraints here and also the assembler. -func CompilerSupported() bool { - switch runtime.GOOS { - case "linux", "darwin", "freebsd", "netbsd", "dragonfly", "windows": - return archRequirementsVerified - case "solaris", "illumos": - return runtime.GOARCH == "amd64" && archRequirementsVerified - default: - return false - } -} - -// MmapCodeSegment copies the code into the executable region and returns the byte slice of the region. -// -// See https://man7.org/linux/man-pages/man2/mmap.2.html for mmap API and flags. -func MmapCodeSegment(size int) ([]byte, error) { - if size == 0 { - panic("BUG: MmapCodeSegment with zero length") - } - if runtime.GOARCH == "amd64" { - return mmapCodeSegmentAMD64(size) - } else { - return mmapCodeSegmentARM64(size) - } -} - -// MunmapCodeSegment unmaps the given memory region. -func MunmapCodeSegment(code []byte) error { - if len(code) == 0 { - panic("BUG: MunmapCodeSegment with zero length") - } - return munmapCodeSegment(code) -} |