1
0
mirror of https://github.com/rclone/rclone.git synced 2025-10-06 05:47:10 +02:00
Files
rclone/lib/mmap/mmap_unsupported.go
Nick Craig-Wood d67aa9cc7b build: make rclone compile with GOOS=wasip1 GOARCH=wasm #7831
This now compiles but the link doesn't work because of

https://github.com/golang/go/issues/64856
2025-07-09 10:53:03 +01:00

20 lines
595 B
Go

// Fallback Alloc and Free for unsupported OSes
//go:build plan9 || js || wasm
package mmap
// Alloc allocates size bytes and returns a slice containing them. If
// the allocation fails it will return with an error. This is best
// used for allocations which are a multiple of the Pagesize.
func Alloc(size int) ([]byte, error) {
return make([]byte, size), nil
}
// Free frees buffers allocated by Alloc. Note it should be passed
// the same slice (not a derived slice) that Alloc returned. If the
// free fails it will return with an error.
func Free(mem []byte) error {
return nil
}