Source File
platform.go
Belonging Package
github.com/tetratelabs/wazero/internal/platform
// 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 platformimport ()// CompilerSupported includes constraints here and also the assembler.func () bool {return CompilerSupports(api.CoreFeaturesV2)}func ( api.CoreFeatures) bool {switch runtime.GOOS {case "linux", "darwin", "freebsd", "netbsd", "dragonfly", "windows":if runtime.GOARCH == "arm64" {if .IsEnabled(experimental.CoreFeaturesThreads) {return CpuFeatures.Has(CpuFeatureArm64Atomic)}return true}fallthroughcase "solaris", "illumos":return runtime.GOARCH == "amd64" && CpuFeatures.Has(CpuFeatureAmd64SSE4_1)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 ( int) ([]byte, error) {if == 0 {panic("BUG: MmapCodeSegment with zero length")}if runtime.GOARCH == "amd64" {return mmapCodeSegmentAMD64()} else {return mmapCodeSegmentARM64()}}// MunmapCodeSegment unmaps the given memory region.func ( []byte) error {if len() == 0 {panic("BUG: MunmapCodeSegment with zero length")}return munmapCodeSegment()}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |