Documentation ¶
Overview ¶
Package buffer implements compile.CodeBuffer and compile.DataBuffer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSizeLimit error = err{}
Functions ¶
This section is empty.
Types ¶
type Dynamic ¶ added in v0.32.0
type Dynamic struct {
// contains filtered or unexported fields
}
Dynamic is a variable-capacity buffer. The default value is a valid buffer.
func MakeDynamic ¶ added in v0.32.0
MakeDynamic buffer.
This function can be used in field initializer expressions. The initialized field must not be copied.
func MakeDynamicHint ¶ added in v0.32.0
MakeDynamicHint avoids making excessive allocations if the maximum buffer size can be estimated in advance. The slice must be empty.
This function can be used in field initializer expressions. The initialized field must not be copied.
func NewDynamicHint ¶ added in v0.32.0
NewDynamicHint avoids making excessive allocations if the maximum buffer size can be estimated in advance. The slice must be empty.
func (*Dynamic) ResizeBytes ¶ added in v0.32.0
ResizeBytes doesn't panic unless out of memory.
type Limited ¶ added in v0.32.0
type Limited struct {
// contains filtered or unexported fields
}
Limited is a dynamic buffer with a maximum size. The default value is an empty buffer that cannot grow.
func MakeLimited ¶ added in v0.32.0
MakeLimited buffer with a maximum size. The slice must be empty.
This function can be used in field initializer expressions. The initialized field must not be copied.
func NewLimited ¶ added in v0.32.0
NewLimited buffer with a maximum size. The slice must be empty.
func (*Limited) Extend ¶ added in v0.32.0
Extend panics with ErrSizeLimit if n bytes cannot be appended to the buffer.
func (*Limited) PutByte ¶ added in v0.32.0
PutByte panics with ErrSizeLimit if the buffer is already full.
func (*Limited) PutUint32 ¶ added in v0.32.0
Extend panics with ErrSizeLimit if 4 bytes cannot be appended to the buffer.
func (*Limited) ResizeBytes ¶ added in v0.32.0
ResizeBytes panics with ErrSizeLimit if n is larger than maximum buffer size.
type Static ¶ added in v0.32.0
type Static struct {
// contains filtered or unexported fields
}
Static is a fixed-capacity buffer, for wrapping a memory-mapped region. The default value is a zero-capacity buffer.
func MakeStatic ¶ added in v0.32.0
MakeStatic buffer.
This function can be used in field initializer expressions. The initialized field must not be copied.
func (*Static) Extend ¶ added in v0.32.0
Extend panics with ErrSizeLimit if n bytes cannot be appended to the buffer.
func (*Static) PutByte ¶ added in v0.32.0
PutByte panics with ErrSizeLimit if the buffer is already full.
func (*Static) PutUint32 ¶ added in v0.32.0
Extend panics with ErrSizeLimit if 4 bytes cannot be appended to the buffer.
func (*Static) ResizeBytes ¶ added in v0.32.0
ResizeBytes panics with ErrSizeLimit if n is larger than buffer capacity.