types

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocation

type Allocation struct {
	ResourceIdent
	Amount   int64 // bytes
	NUMAZone int64
}

Currently, an Allocation currently can only be a proper subset of a Span.

func (Allocation) Pages

func (ac Allocation) Pages() int64

func (Allocation) String

func (ac Allocation) String() string

func (Allocation) ToQuantityString

func (ac Allocation) ToQuantityString() string

type ResourceIdent

type ResourceIdent struct {
	Kind     ResourceKind
	Pagesize uint64 //bytes
}

func ResourceIdentFromName

func ResourceIdentFromName(name string) (ResourceIdent, error)

name is in the form `memory-4Ki` or `hugepages-1Gi`

func (ResourceIdent) CapacityName

func (ri ResourceIdent) CapacityName() resourceapi.QualifiedName

func (ResourceIdent) FullName

func (ri ResourceIdent) FullName() string

FullName returns a non-canonical, roundtrip-able name

func (ResourceIdent) MinimumAllocatable

func (ri ResourceIdent) MinimumAllocatable() uint64

func (ResourceIdent) Name

func (ri ResourceIdent) Name() string

Name returns the canonical name which is not roundtrip-able

func (ResourceIdent) NeedsHugeTLB

func (ri ResourceIdent) NeedsHugeTLB() bool

func (ResourceIdent) PagesizeString

func (ri ResourceIdent) PagesizeString() string

type ResourceKind

type ResourceKind string
const (
	Memory    ResourceKind = "memory"
	Hugepages ResourceKind = "hugepages"
)

type Span

type Span struct {
	ResourceIdent
	Amount   int64 // bytes
	NUMAZone int64
}

A Span is a memory area

func (Span) MakeAllocation

func (sp Span) MakeAllocation(amount int64) Allocation

func (Span) Pages

func (sp Span) Pages() int64

func (Span) String

func (sp Span) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL