Skip to content

Instantly share code, notes, and snippets.

View mokiat's full-sized avatar

Momchil Atanasov mokiat

View GitHub Profile
@mokiat
mokiat / frameheap.go
Last active August 29, 2015 14:28
An example FrameHeap in Go
package main
import "fmt"
import "unsafe"
func NewFrameHeap(size int) *FrameHeap {
buffer := make([]uint8, size)
location := uintptr(unsafe.Pointer(&buffer[0]))
return &FrameHeap{
buffer: buffer, // Store it to prevent GC?