arrow: github.com/apache/arrow/go/arrow/memory Index | Files

package memory

import "github.com/apache/arrow/go/arrow/memory"

Package memory provides support for allocating and manipulating memory at a low level.

Index

Package Files

allocator.go buffer.go checked_allocator.go doc.go go_allocator.go memory.go memory_amd64.go memory_avx2_amd64.go memory_sse4_amd64.go util.go

func Set Uses

func Set(buf []byte, c byte)

Set assigns the value c to every element of the slice buf.

type Allocator Uses

type Allocator interface {
    Allocate(size int) []byte
    Reallocate(size int, b []byte) []byte
    Free(b []byte)
}
var DefaultAllocator Allocator = NewGoAllocator()

DefaultAllocator is a default implementation of Allocator and can be used anywhere an Allocator is required.

DefaultAllocator is safe to use from multiple goroutines.

type Buffer Uses

type Buffer struct {
    // contains filtered or unexported fields
}

func NewBufferBytes Uses

func NewBufferBytes(data []byte) *Buffer

NewBufferBytes creates a fixed-size buffer from the specified data.

func NewResizableBuffer Uses

func NewResizableBuffer(mem Allocator) *Buffer

NewBuffer creates a mutable, resizable buffer with an Allocator for managing memory.

func (*Buffer) Buf Uses

func (b *Buffer) Buf() []byte

Buf returns the slice of memory allocated by the Buffer, which is adjusted by calling Reserve.

func (*Buffer) Bytes Uses

func (b *Buffer) Bytes() []byte

Bytes returns a slice of size Len, which is adjusted by calling Resize.

func (*Buffer) Cap Uses

func (b *Buffer) Cap() int

func (*Buffer) Len Uses

func (b *Buffer) Len() int

func (*Buffer) Mutable Uses

func (b *Buffer) Mutable() bool

func (*Buffer) Release Uses

func (b *Buffer) Release()

Release decreases the reference count by 1. When the reference count goes to zero, the memory is freed.

func (*Buffer) Reserve Uses

func (b *Buffer) Reserve(capacity int)

func (*Buffer) Resize Uses

func (b *Buffer) Resize(newSize int)

func (*Buffer) ResizeNoShrink Uses

func (b *Buffer) ResizeNoShrink(newSize int)

func (*Buffer) Retain Uses

func (b *Buffer) Retain()

Retain increases the reference count by 1.

type CheckedAllocator Uses

type CheckedAllocator struct {
    // contains filtered or unexported fields
}

func NewCheckedAllocator Uses

func NewCheckedAllocator(mem Allocator) *CheckedAllocator

func (*CheckedAllocator) Allocate Uses

func (a *CheckedAllocator) Allocate(size int) []byte

func (*CheckedAllocator) AssertSize Uses

func (a *CheckedAllocator) AssertSize(t TestingT, sz int)

func (*CheckedAllocator) Free Uses

func (a *CheckedAllocator) Free(b []byte)

func (*CheckedAllocator) Reallocate Uses

func (a *CheckedAllocator) Reallocate(size int, b []byte) []byte

type CheckedAllocatorScope Uses

type CheckedAllocatorScope struct {
    // contains filtered or unexported fields
}

func NewCheckedAllocatorScope Uses

func NewCheckedAllocatorScope(alloc *CheckedAllocator) *CheckedAllocatorScope

func (*CheckedAllocatorScope) CheckSize Uses

func (c *CheckedAllocatorScope) CheckSize(t TestingT)

type GoAllocator Uses

type GoAllocator struct{}

func NewGoAllocator Uses

func NewGoAllocator() *GoAllocator

func (*GoAllocator) Allocate Uses

func (a *GoAllocator) Allocate(size int) []byte

func (*GoAllocator) Free Uses

func (a *GoAllocator) Free(b []byte)

func (*GoAllocator) Reallocate Uses

func (a *GoAllocator) Reallocate(size int, b []byte) []byte

type TestingT Uses

type TestingT interface {
    Errorf(format string, args ...interface{})
    Helper()
}

Package memory imports 4 packages (graph) and is imported by 9 packages. Updated 2019-02-28. Refresh now. Tools for package owners.