win32-mmap 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +78 -70
- data/MANIFEST +13 -10
- data/README +71 -71
- data/Rakefile +45 -48
- data/appveyor.yml +46 -0
- data/certs/djberg96_pub.pem +21 -0
- data/examples/example_mmap_client.rb +19 -19
- data/examples/example_mmap_file.rb +24 -24
- data/examples/example_mmap_server.rb +19 -19
- data/lib/win32-mmap.rb +1 -0
- data/lib/win32/mmap.rb +406 -406
- data/lib/win32/windows/constants.rb +41 -41
- data/lib/win32/windows/functions.rb +50 -50
- data/lib/win32/windows/structs.rb +28 -28
- data/test/test_win32_mmap.rb +113 -113
- data/win32-mmap.gemspec +25 -25
- metadata +44 -13
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d610c448f2f5f137cc5d8424fdaa303dd3b7d63
|
4
|
+
data.tar.gz: fa47a4a04b92508d7c6ca60f48747b5b46753c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e58ed3af8d33045beeafd3824e987b16a749c07620f12ce180f7590bed552ff182c56bdf6ec7bd316f4e33bd2725f39f0316fe63f732586b91632670c816599
|
7
|
+
data.tar.gz: bd9c9470331b64c3b080e67f9db1fb35c10940c72340428a35ea29d2d05048c06ea495e141f5d795b3b49d18629caa9aab943a5390c7e69e4c8828f73b9dd58f
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
data/CHANGES
CHANGED
@@ -1,70 +1,78 @@
|
|
1
|
-
== 0.4.
|
2
|
-
*
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
*
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
*
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
== 0.3.
|
19
|
-
*
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
*
|
25
|
-
|
26
|
-
== 0.
|
27
|
-
*
|
28
|
-
|
29
|
-
|
30
|
-
*
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
*
|
37
|
-
*
|
38
|
-
*
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
*
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
*
|
52
|
-
|
53
|
-
*
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
*
|
60
|
-
|
61
|
-
|
62
|
-
*
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
*
|
68
|
-
|
69
|
-
== 0.0
|
70
|
-
*
|
1
|
+
== 0.4.2 - 12-Nov-2015
|
2
|
+
* Added a win32-mmap.rb file for convenience.
|
3
|
+
* This gem is now signed.
|
4
|
+
* Use require_relative where appropriate.
|
5
|
+
* Added an appveyor.yml file for the MS continuous integration service.
|
6
|
+
* The gem tasks in the Rakefile now assume Rubygems 2.x.
|
7
|
+
* References to the rubyforge_project in the gemspec were removed.
|
8
|
+
|
9
|
+
== 0.4.1 - 21-Oct-2013
|
10
|
+
* Fixed the INVALID_HANDLE_VALUE constant for 64-bit Ruby.
|
11
|
+
* Added rake and test-unit as development dependencies.
|
12
|
+
|
13
|
+
== 0.4.0 - 21-Aug-2013
|
14
|
+
* Added methods for reading or writing raw strings to the underlying
|
15
|
+
memory mapped file (as opposed to marshalled data). Thanks go to
|
16
|
+
Frank Quednau for the patch.
|
17
|
+
|
18
|
+
== 0.3.2 - 28-Apr-2013
|
19
|
+
* Fixed a prototype mismatch in a call to CreateFile. Thanks go to
|
20
|
+
Frank Quednau for the spot.
|
21
|
+
|
22
|
+
== 0.3.1 - 26-Apr-2013
|
23
|
+
* Added the missing OPEN_ALWAYS constant. Thanks go to Frank Quednau.
|
24
|
+
* Set the dependency properly (ffi now, not windows-pr).
|
25
|
+
|
26
|
+
== 0.3.0 - 10-Apr-2013
|
27
|
+
* Converted code to use FFI.
|
28
|
+
|
29
|
+
== 0.2.4 - 28-Apr-2010
|
30
|
+
* The Rakefile was refactored. It now handles gem creation, building and
|
31
|
+
cleanup.
|
32
|
+
* Inline code was removed from the gemspec.
|
33
|
+
|
34
|
+
== 0.2.3 - 12-Aug-2009
|
35
|
+
* Changed license to Artistic 2.0.
|
36
|
+
* The MMap.open method now properly handles a block.
|
37
|
+
* Some gemspec updates, including the license and description.
|
38
|
+
* Changed test and example file names.
|
39
|
+
* Some Rakefile updates, including tasks for running example programs.
|
40
|
+
|
41
|
+
== 0.2.2 - 16-May-2007
|
42
|
+
* Fixed a bug where marshalled data that happened to end with a "\0" would
|
43
|
+
cause the getter to fail.
|
44
|
+
* Now runs -w clean.
|
45
|
+
* Added more tests.
|
46
|
+
* Removed the install.rb file. Installation is now handled via the 'rake
|
47
|
+
install' task.
|
48
|
+
* Updated the MANIFEST file and made it rdoc friendly.
|
49
|
+
|
50
|
+
== 0.2.1 - 22-Oct-2006
|
51
|
+
* Removed the custom memcpy function since that function now does the right
|
52
|
+
thing regardless of argument type.
|
53
|
+
* Now requires windows-pr 0.5.6 or later (to take advantage of the improved
|
54
|
+
memcpy).
|
55
|
+
|
56
|
+
== 0.2.0 - 13-Oct-2006
|
57
|
+
* Completely scrapped the old interface and code. It is now pure Ruby and
|
58
|
+
has a much different API, and some internal changes.
|
59
|
+
* Added a gemspec and an install.rb file for manual installation.
|
60
|
+
* Now requires the windows-pr package, 0.5.5 or higher.
|
61
|
+
* Modified the example scripts.
|
62
|
+
* Updated the docs, and replaced the .txt and .rd files with a single .rdoc
|
63
|
+
file.
|
64
|
+
|
65
|
+
== 0.1.1 - 1-Mar-2005
|
66
|
+
* Moved the 'examples' directory to the toplevel directory.
|
67
|
+
* Made the CHANGES and README files rdoc friendly.
|
68
|
+
|
69
|
+
== 0.1.0 - 12-Aug-2004
|
70
|
+
* Modified to use the newer allocation framework. That means that, as of
|
71
|
+
this release, this package requires Ruby 1.8.0 or later.
|
72
|
+
* Moved sample programs under doc/examples.
|
73
|
+
|
74
|
+
== 0.0.2 - 14-Mar-2004
|
75
|
+
* Fixed sprintf() bug in new().
|
76
|
+
|
77
|
+
== 0.0.1 - 13-Mar-2004
|
78
|
+
* Initial (Beta) release
|
data/MANIFEST
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
-
*
|
2
|
-
*
|
3
|
-
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
* examples/
|
9
|
-
*
|
10
|
-
*
|
1
|
+
* appveyor.yml
|
2
|
+
* CHANGES
|
3
|
+
* MANIFEST
|
4
|
+
* README
|
5
|
+
* Rakefile
|
6
|
+
* win32-mmap.gemspec
|
7
|
+
* certs/djberg96_pub.pem
|
8
|
+
* examples/example_mmap.rb
|
9
|
+
* examples/example_mmap_client.rb
|
10
|
+
* examples/example_mmap_server.rb
|
11
|
+
* lib/win32-mmap.rb
|
12
|
+
* lib/win32/mmap.rb
|
13
|
+
* test/test_win32_mmap.rb
|
data/README
CHANGED
@@ -1,71 +1,71 @@
|
|
1
|
-
= Description
|
2
|
-
This package provides a Ruby interface for memory mapped I/O on MS Windows.
|
3
|
-
|
4
|
-
= Prerequisites
|
5
|
-
* ffi
|
6
|
-
* test-unit (Testing only)
|
7
|
-
|
8
|
-
= Installation
|
9
|
-
gem install win32-mmap
|
10
|
-
|
11
|
-
= Synopsis
|
12
|
-
require 'win32/mmap'
|
13
|
-
include Win32
|
14
|
-
|
15
|
-
map1 = MMap.new(:file => "C:\\test.map", :size => 1024)
|
16
|
-
map1.foo = 'hello'
|
17
|
-
map1.bar = 77
|
18
|
-
map1.close
|
19
|
-
|
20
|
-
map2 = MMap.new(:file => "C:\\test.map")
|
21
|
-
p map2.foo # 'hello'
|
22
|
-
p map2.bar # 77
|
23
|
-
map2.close
|
24
|
-
|
25
|
-
= About Memory Mapped Files under Windows
|
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.
|
32
|
-
|
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.
|
37
|
-
|
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.
|
43
|
-
|
44
|
-
In short, memory mapped files provide shared memory under Windows.
|
45
|
-
|
46
|
-
(This explanation was largely borrowed from Roger Lee's Win32::MMF Perl
|
47
|
-
module.)
|
48
|
-
|
49
|
-
== Contributions
|
50
|
-
Although this library is free, please consider having your company
|
51
|
-
setup a gittip if used by your company professionally.
|
52
|
-
|
53
|
-
http://www.gittip.com/djberg96/
|
54
|
-
|
55
|
-
= Future Plans
|
56
|
-
Suggestions welcome.
|
57
|
-
|
58
|
-
= License
|
59
|
-
Artistic 2.0
|
60
|
-
|
61
|
-
= Copyright
|
62
|
-
(C) 2003-2013 Daniel J. Berger, All Rights Reserved
|
63
|
-
|
64
|
-
= Warranty
|
65
|
-
This package is provided "as is" and without any express or
|
66
|
-
implied warranties, including, without limitation, the implied
|
67
|
-
warranties of merchantability and fitness for a particular purpose.
|
68
|
-
|
69
|
-
= Authors
|
70
|
-
Daniel J. Berger
|
71
|
-
Park Heesob
|
1
|
+
= Description
|
2
|
+
This package provides a Ruby interface for memory mapped I/O on MS Windows.
|
3
|
+
|
4
|
+
= Prerequisites
|
5
|
+
* ffi
|
6
|
+
* test-unit (Testing only)
|
7
|
+
|
8
|
+
= Installation
|
9
|
+
gem install win32-mmap
|
10
|
+
|
11
|
+
= Synopsis
|
12
|
+
require 'win32/mmap'
|
13
|
+
include Win32
|
14
|
+
|
15
|
+
map1 = MMap.new(:file => "C:\\test.map", :size => 1024)
|
16
|
+
map1.foo = 'hello'
|
17
|
+
map1.bar = 77
|
18
|
+
map1.close
|
19
|
+
|
20
|
+
map2 = MMap.new(:file => "C:\\test.map")
|
21
|
+
p map2.foo # 'hello'
|
22
|
+
p map2.bar # 77
|
23
|
+
map2.close
|
24
|
+
|
25
|
+
= About Memory Mapped Files under Windows
|
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.
|
32
|
+
|
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.
|
37
|
+
|
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.
|
43
|
+
|
44
|
+
In short, memory mapped files provide shared memory under Windows.
|
45
|
+
|
46
|
+
(This explanation was largely borrowed from Roger Lee's Win32::MMF Perl
|
47
|
+
module.)
|
48
|
+
|
49
|
+
== Contributions
|
50
|
+
Although this library is free, please consider having your company
|
51
|
+
setup a gittip if used by your company professionally.
|
52
|
+
|
53
|
+
http://www.gittip.com/djberg96/
|
54
|
+
|
55
|
+
= Future Plans
|
56
|
+
Suggestions welcome.
|
57
|
+
|
58
|
+
= License
|
59
|
+
Artistic 2.0
|
60
|
+
|
61
|
+
= Copyright
|
62
|
+
(C) 2003-2013 Daniel J. Berger, All Rights Reserved
|
63
|
+
|
64
|
+
= Warranty
|
65
|
+
This package is provided "as is" and without any express or
|
66
|
+
implied warranties, including, without limitation, the implied
|
67
|
+
warranties of merchantability and fitness for a particular purpose.
|
68
|
+
|
69
|
+
= Authors
|
70
|
+
Daniel J. Berger
|
71
|
+
Park Heesob
|
data/Rakefile
CHANGED
@@ -1,48 +1,45 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/clean'
|
3
|
-
require 'rake/testtask'
|
4
|
-
|
5
|
-
CLEAN.include('**/*.gem')
|
6
|
-
|
7
|
-
namespace 'gem' do
|
8
|
-
desc 'Create the win32-mmap gem.'
|
9
|
-
task :create => [:clean] do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
task :default => :test
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
CLEAN.include('**/*.gem')
|
6
|
+
|
7
|
+
namespace 'gem' do
|
8
|
+
desc 'Create the win32-mmap gem.'
|
9
|
+
task :create => [:clean] do
|
10
|
+
require 'rubygems/package'
|
11
|
+
spec = eval(IO.read('win32-mmap.gemspec'))
|
12
|
+
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
|
13
|
+
Gem::Package.build(spec, true)
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Install the win32-mmap gem.'
|
17
|
+
task :install => [:create] do
|
18
|
+
file = Dir['*.gem'].first
|
19
|
+
sh "gem install -l #{file}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
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
|
28
|
+
|
29
|
+
desc 'Run the example mmap server'
|
30
|
+
task :server do
|
31
|
+
ruby '-Ilib examples/example_mmap_server.rb'
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Run the example mmap client'
|
35
|
+
task :client do
|
36
|
+
ruby '-Ilib examples/example_mmap_client.rb'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Rake::TestTask.new do |t|
|
41
|
+
t.verbose = true
|
42
|
+
t.warning = true
|
43
|
+
end
|
44
|
+
|
45
|
+
task :default => :test
|
data/appveyor.yml
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
version: '{build}'
|
2
|
+
branches:
|
3
|
+
only:
|
4
|
+
- ffi
|
5
|
+
skip_tags: true
|
6
|
+
clone_depth: 10
|
7
|
+
environment:
|
8
|
+
matrix:
|
9
|
+
- ruby_version: 193
|
10
|
+
ruby_dir: 1.9.1
|
11
|
+
- ruby_version: 200
|
12
|
+
ruby_dir: 2.0.0
|
13
|
+
- ruby_version: 200-x64
|
14
|
+
ruby_dir: 2.0.0
|
15
|
+
- ruby_version: 21
|
16
|
+
ruby_dir: 2.1.0
|
17
|
+
- ruby_version: 21-x64
|
18
|
+
ruby_dir: 2.1.0
|
19
|
+
- ruby_version: 22
|
20
|
+
ruby_dir: 2.2.0
|
21
|
+
- ruby_version: 22-x64
|
22
|
+
ruby_dir: 2.2.0
|
23
|
+
install:
|
24
|
+
- ps: >-
|
25
|
+
$env:path = "C:\Ruby" + $env:ruby_version + "\bin;" + $env:path
|
26
|
+
|
27
|
+
$tpath = "C:\Ruby" + $env:ruby_version + "\lib\ruby\" + $env:ruby_dir + "\test"
|
28
|
+
|
29
|
+
if ((test-path $tpath) -eq $True){ rm -recurse -force $tpath }
|
30
|
+
|
31
|
+
gem update --system > $null
|
32
|
+
|
33
|
+
if ((gem query -i ffi) -eq $False){ gem install ffi --no-document }
|
34
|
+
|
35
|
+
if ((gem query -i test-unit -v ">= 3.0") -eq $False){ gem install test-unit --no-document }
|
36
|
+
cache:
|
37
|
+
- C:\Ruby193\lib\ruby\gems\1.9.1
|
38
|
+
- C:\Ruby200\lib\ruby\gems\2.0.0
|
39
|
+
- C:\Ruby200-x64\lib\ruby\gems\2.0.0
|
40
|
+
- C:\Ruby21\lib\ruby\gems\2.1.0
|
41
|
+
- C:\Ruby21-x64\lib\ruby\gems\2.1.0
|
42
|
+
- C:\Ruby22\lib\ruby\gems\2.2.0
|
43
|
+
- C:\Ruby22-x64\lib\ruby\gems\2.2.0
|
44
|
+
build: off
|
45
|
+
test_script:
|
46
|
+
- cmd: rake
|