rclone: github.com/ncw/rclone/lib/mmap Index | Files

package mmap

import "github.com/ncw/rclone/lib/mmap"

Index

Package Files

mmap.go mmap_unix.go

Variables

var PageSize = os.Getpagesize()

PageSize is the minimum allocation size. Allocations will use at least this size and are likely to be multiplied up to a multiple of this size.

func Alloc Uses

func Alloc(size int) ([]byte, error)

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 Free Uses

func Free(mem []byte) error

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 MustAlloc Uses

func MustAlloc(size int) []byte

MustAlloc allocates size bytes and returns a slice containing them. If the allocation fails it will panic. This is best used for allocations which are a multiple of the PageSize.

func MustFree Uses

func MustFree(mem []byte)

MustFree 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 panic.

Package mmap imports 3 packages (graph). Updated 2019-02-22. Refresh now. Tools for package owners.