memcall/README.md
2020-03-10 22:24:10 +00:00

1,016 B

memcall

Cirrus CI GoDoc Go Report Card

This package provides a cross-platform wrapper allowing you to allocate memory outside of the garbage-collected Go heap.

Please report any issues that you experience.

Usage

// Allocate space for a key in a memory region locked into memory.
k, _ := memcall.Create(32, memcall.Readable, memcall.Writable, memcall.Locked)

// Get some random bytes
_ = k.Scramble()

// Use it
ciphertext := crypto.Encrypt(plaintext, k.Bytes())

// Get rid of it
_ = k.Destroy()

Full documentation.

Todo:

  • Realloc support.
  • Improve tests.
  • Allocate more efficiently.