github.com/ncw/rclone@v1.48.1-0.20190724201158-a35aa1360e3e/lib/mmap/mmap_unsupported.go (about)

     1  // Fallback Alloc and Free for unsupported OSes
     2  
     3  // +build plan9
     4  
     5  package mmap
     6  
     7  // Alloc allocates size bytes and returns a slice containing them.  If
     8  // the allocation fails it will return with an error.  This is best
     9  // used for allocations which are a multiple of the Pagesize.
    10  func Alloc(size int) ([]byte, error) {
    11  	return make([]byte, size), nil
    12  }
    13  
    14  // Free frees buffers allocated by Alloc.  Note it should be passed
    15  // the same slice (not a derived slice) that Alloc returned.  If the
    16  // free fails it will return with an error.
    17  func Free(mem []byte) error {
    18  	return nil
    19  }