Documentation
¶
Overview ¶
Package lockedmem holds secrets outside the Go heap: each Buf is an anonymous mapping of its own, so the collector never copies it, locked against swap where RLIMIT_MEMLOCK allows, excluded from core dumps, and zeroed before it is unmapped.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buf ¶
type Buf struct {
// contains filtered or unexported fields
}
Buf is n bytes of locked memory. The zero Buf, and a destroyed one, hold nothing.
func (*Buf) Bytes ¶
Bytes is the buffer's memory, nil once destroyed. It must not be kept past Destroy.
func (*Buf) Destroy ¶
func (b *Buf) Destroy()
Destroy zeroes and unmaps the buffer. It is safe to call more than once.