Cross-platform wrapper for memory-related system calls.
Find a file
2020-03-11 10:50:11 +00:00
.cirrus.yml Update OSX platform version 2020-03-10 23:12:13 +00:00
go.mod Update deps 2020-03-10 23:09:49 +00:00
go.sum Update deps 2020-03-10 23:09:49 +00:00
LICENSE Initial commit 2019-08-01 10:53:53 +01:00
memcall.go Implement newer higher-level API 2020-03-10 22:16:30 +00:00
memcall_freebsd.go FreeBSD does not have MADV_DONT_DUMP 2020-03-10 23:08:35 +00:00
memcall_openbsd.go Implement newer higher-level API 2020-03-10 22:16:30 +00:00
memcall_osx.go OSX does not have MADV_DONTDUMP 2020-03-10 22:20:12 +00:00
memcall_test.go Implement newer higher-level API 2020-03-10 22:16:30 +00:00
memcall_unix.go Implement newer higher-level API 2020-03-10 22:16:30 +00:00
memcall_windows.go Fix windows test again 2020-03-11 10:50:11 +00:00
README.md Add docs link 2020-03-10 22:24:10 +00:00

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.