github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/platform/mremap_other.go (about)

     1  //go:build !(darwin || linux || freebsd)
     2  
     3  package platform
     4  
     5  func remapCodeSegmentAMD64(code []byte, size int) ([]byte, error) {
     6  	b, err := mmapCodeSegmentAMD64(size)
     7  	if err != nil {
     8  		return nil, err
     9  	}
    10  	copy(b, code)
    11  	mustMunmapCodeSegment(code)
    12  	return b, nil
    13  }
    14  
    15  func remapCodeSegmentARM64(code []byte, size int) ([]byte, error) {
    16  	b, err := mmapCodeSegmentARM64(size)
    17  	if err != nil {
    18  		return nil, err
    19  	}
    20  	copy(b, code)
    21  	mustMunmapCodeSegment(code)
    22  	return b, nil
    23  }