win32-mmap 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/README +40 -46
- data/Rakefile +32 -20
- data/lib/win32/mmap.rb +1 -1
- data/test/test_win32_mmap.rb +1 -1
- data/win32-mmap.gemspec +19 -21
- metadata +19 -10
data/CHANGES
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.2.4 - 28-Apr-2010
|
2
|
+
* The Rakefile was refactored. It now handles gem creation, building and
|
3
|
+
cleanup.
|
4
|
+
* Inline code was removed from the gemspec.
|
5
|
+
* Removed the doc directory from the repository. The information that was
|
6
|
+
there is already covered in the README.
|
7
|
+
|
1
8
|
== 0.2.3 - 12-Aug-2009
|
2
9
|
* Changed license to Artistic 2.0.
|
3
10
|
* The MMap.open method now properly handles a block.
|
data/README
CHANGED
@@ -1,71 +1,65 @@
|
|
1
1
|
= Description
|
2
|
-
|
2
|
+
This package provides a Ruby interface for memory mapped I/O on MS Windows.
|
3
3
|
|
4
4
|
= Prerequisites
|
5
|
-
|
6
|
-
|
5
|
+
Ruby 1.8.2 or later.
|
6
|
+
windows-pr, 0.5.5 or later.
|
7
7
|
|
8
8
|
= Installation
|
9
|
-
|
10
|
-
rake test (optional)
|
11
|
-
rake install
|
12
|
-
|
13
|
-
== Gem Installation
|
14
|
-
ruby win32-mmap.gemspec
|
15
|
-
gem install win32-mmap-x.y.z.gem
|
9
|
+
gem install win32-mmap
|
16
10
|
|
17
11
|
= Synopsis
|
18
|
-
|
19
|
-
|
12
|
+
require 'win32/mmap'
|
13
|
+
include Win32
|
20
14
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
map1 = MMap.new(:file => "C:\\test.map", :size => 1024)
|
16
|
+
map1.foo = 'hello'
|
17
|
+
map1.bar = 77
|
18
|
+
map1.close
|
25
19
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
20
|
+
map2 = MMap.new(:file => "C:\\test.map")
|
21
|
+
p map2.foo # 'hello'
|
22
|
+
p map2.bar # 77
|
23
|
+
map2.close
|
30
24
|
|
31
25
|
= About Memory Mapped Files under Windows
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
26
|
+
Under Windows, code and data are both repesented by pages of memory backed
|
27
|
+
by files on disk, code by executable image and data by system pagefile
|
28
|
+
(i.e. swapfile). These are called memory mapped files. Memory mapped files
|
29
|
+
can be used to provide a mechanism for shared memory between processes.
|
30
|
+
Different processes are able to share data backed by the same swapfile,
|
31
|
+
whether it's the system pagefile or a user-defined swapfile.
|
38
32
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
33
|
+
Windows has a tight security system that prevents processes from directly
|
34
|
+
sharing information among each other, but mapped memory files provide a
|
35
|
+
mechanism that works with the Windows security system by using a name that
|
36
|
+
all processes use to open the swapfile.
|
43
37
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
38
|
+
A shared section of the swapfile is translated into pages of memory that are
|
39
|
+
addressable by more than one process, Windows uses a system resource called a
|
40
|
+
prototype page table entry (PPTE) to enable more than one process to address
|
41
|
+
the same physical page of memory, thus multiple process can share the same
|
42
|
+
data without violating the Windows system security.
|
49
43
|
|
50
|
-
|
44
|
+
In short, memory mapped files provide shared memory under Windows.
|
51
45
|
|
52
|
-
|
53
|
-
|
46
|
+
(This explanation was largely borrowed from Roger Lee's Win32::MMF Perl
|
47
|
+
module.)
|
54
48
|
|
55
49
|
= Future Plans
|
56
|
-
|
50
|
+
Suggestions welcome.
|
57
51
|
|
58
52
|
= License
|
59
|
-
|
53
|
+
Artistic 2.0
|
60
54
|
|
61
55
|
= Copyright
|
62
|
-
|
56
|
+
(C) 2003-2010 Daniel J. Berger, All Rights Reserved
|
63
57
|
|
64
58
|
= Warranty
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
This package is provided "as is" and without any express or
|
60
|
+
implied warranties, including, without limitation, the implied
|
61
|
+
warranties of merchantability and fitness for a particular purpose.
|
68
62
|
|
69
63
|
= Authors
|
70
|
-
|
71
|
-
|
64
|
+
Daniel J. Berger
|
65
|
+
Park Heesob
|
data/Rakefile
CHANGED
@@ -1,31 +1,43 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/testtask'
|
3
|
-
require 'rbconfig'
|
4
|
-
include Config
|
5
3
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
namespace 'gem' do
|
5
|
+
desc 'Delete any gem files in the project.'
|
6
|
+
task :clean do
|
7
|
+
Dir['*.gem'].each{ |f| File.delete(f) }
|
8
|
+
end
|
11
9
|
|
12
|
-
|
13
|
-
|
10
|
+
desc 'Create the win32-mmap gem.'
|
11
|
+
task :create => [:clean] do
|
12
|
+
spec = eval(IO.read('win32-mmap.gemspec'))
|
13
|
+
Gem::Builder.new(spec).build
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Install the win32-mmap gem.'
|
17
|
+
task :install => [:create] do
|
18
|
+
file = Dir['*.gem'].first
|
19
|
+
sh "gem install #{file}"
|
20
|
+
end
|
14
21
|
end
|
15
22
|
|
16
|
-
|
17
|
-
|
18
|
-
|
23
|
+
namespace 'example' do
|
24
|
+
desc 'Run the example mmap file program'
|
25
|
+
task :file do
|
26
|
+
ruby '-Ilib examples/example_mmap_file.rb'
|
27
|
+
end
|
19
28
|
|
20
|
-
desc 'Run the example mmap server'
|
21
|
-
task :
|
22
|
-
|
29
|
+
desc 'Run the example mmap server'
|
30
|
+
task :server do
|
31
|
+
ruby '-Ilib examples/example_mmap_server.rb'
|
32
|
+
end
|
23
33
|
|
24
|
-
desc 'Run the example mmap client'
|
25
|
-
task :
|
26
|
-
|
34
|
+
desc 'Run the example mmap client'
|
35
|
+
task :client do
|
36
|
+
ruby '-Ilib examples/example_mmap_client.rb'
|
37
|
+
end
|
38
|
+
end
|
27
39
|
|
28
40
|
Rake::TestTask.new do |t|
|
29
|
-
|
30
|
-
|
41
|
+
t.verbose = true
|
42
|
+
t.warning = true
|
31
43
|
end
|
data/lib/win32/mmap.rb
CHANGED
data/test/test_win32_mmap.rb
CHANGED
data/win32-mmap.gemspec
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'win32-mmap'
|
5
|
+
spec.version = '0.2.4'
|
6
|
+
spec.author = 'Daniel J. Berger'
|
7
|
+
spec.license = 'Artistic 2.0'
|
8
|
+
spec.email = 'djberg96@gmail.com'
|
9
|
+
spec.homepage = 'http://www.rubyforge.org/projects/win32utils'
|
10
|
+
spec.platform = Gem::Platform::RUBY
|
11
|
+
spec.summary = 'Memory mapped IO for Windows.'
|
12
|
+
spec.test_file = 'test/test_win32_mmap.rb'
|
13
|
+
spec.has_rdoc = true
|
14
|
+
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
spec.rubyforge_project = 'win32utils'
|
17
|
+
spec.extra_rdoc_files = ['MANIFEST', 'README', 'CHANGES']
|
18
18
|
|
19
|
-
|
19
|
+
spec.add_dependency('windows-pr')
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
spec.description = <<-EOF
|
22
|
+
The win32-mmap library provides an interface for memory mapped IO on
|
23
|
+
MS Windows.
|
24
|
+
EOF
|
25
25
|
end
|
26
|
-
|
27
|
-
Gem::Builder.new(spec).build
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-mmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 4
|
9
|
+
version: 0.2.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Daniel J. Berger
|
@@ -9,20 +14,22 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-04-28 00:00:00 -06:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: windows-pr
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
23
29
|
version: "0"
|
24
|
-
|
25
|
-
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
32
|
+
description: " The win32-mmap library provides an interface for memory mapped IO on\n MS Windows.\n"
|
26
33
|
email: djberg96@gmail.com
|
27
34
|
executables: []
|
28
35
|
|
@@ -56,18 +63,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
63
|
requirements:
|
57
64
|
- - ">="
|
58
65
|
- !ruby/object:Gem::Version
|
66
|
+
segments:
|
67
|
+
- 0
|
59
68
|
version: "0"
|
60
|
-
version:
|
61
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
70
|
requirements:
|
63
71
|
- - ">="
|
64
72
|
- !ruby/object:Gem::Version
|
73
|
+
segments:
|
74
|
+
- 0
|
65
75
|
version: "0"
|
66
|
-
version:
|
67
76
|
requirements: []
|
68
77
|
|
69
78
|
rubyforge_project: win32utils
|
70
|
-
rubygems_version: 1.3.
|
79
|
+
rubygems_version: 1.3.6
|
71
80
|
signing_key:
|
72
81
|
specification_version: 3
|
73
82
|
summary: Memory mapped IO for Windows.
|