Skip to content

brianosaurus/mmap-ruby

Repository files navigation

Usage

This is a very simplistic interface. It will only map anonymous memory. It does not handle memory mapped files. If someone wants to add to this gem please feel free.

Installation

Add this to your gemfile

gem 'mmap-ruby', git: '[email protected]:brianosaurus/mmap-ruby.git' 

Running

offset = 0
len = 4
data = '1234'

@mw = MmapRuby.new(4096)
@mw.write(offset, len, data)
@mw.read(offset, len)

@mw.lock(4096)
@mw.unlock(4096)
@mw.advise(4096, MmapRuby::MADV_SEQUENTIAL)

About

A very basic interface to mmap, mlock, and munlock.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published