Skip to content

Instantly share code, notes, and snippets.

@lyda
Last active February 9, 2017 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyda/ce3d5f238f61ffc1badfa59dc48743d1 to your computer and use it in GitHub Desktop.
Save lyda/ce3d5f238f61ffc1badfa59dc48743d1 to your computer and use it in GitHub Desktop.
Get mmap working with ruby 2.3.1
source "https://rubygems.org"
gem 'mmap', git: 'https://github.com/lyda/mmap.git', :branch => 'non-global-version'
#! /bin/sh
test -f Gemfile.lock && rm Gemfile.lock
bundle install
bundle exec ruby test.rb
require 'mmap'
mmap = Mmap.new(__FILE__)
mmap.advise(Mmap::MADV_SEQUENTIAL)
mmap.each do |line|
puts line
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment