Skip to content

EinfachAndy/fsmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast Fixed-Size Memory Poll (fsmp)

This is an implementation of the paper: computation_tools_2012_1_10_80006.pdf

Features:

  • no golang garbage collection
  • no loops (fast access times)
  • no recursive functions
  • little initialization overhead
  • little memory footprint (few dozen bytes)
  • straightforward and trouble-free algorithm
  • no-fragmentation
  • control and organization of memory
  • usage of a spinlock for fast concurrent access

Install

go get -u github.com/EinfachAndy/fsmp/

Usage

package main

import (
	"encoding/binary"

	"github.com/EinfachAndy/fsmp"
)

func main() {
	pool := fsmp.CreatePool(1, 8)
	b, err := pool.Allocate()
	if err == fsmp.ErrOutOfMemory {
		panic(err.Error())
	}
	value := uint64(1234)
	binary.LittleEndian.PutUint64(b, value)

	pool.DeAllocate(b)
}

License

fsmp source code is available under the MIT License.

About

Fast Fixed-Size Memory Poll

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages