github.com/xhghs/rclone@v1.51.1-0.20200430155106-e186a28cced8/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  }