Daniel Berger
2006-Oct-06 20:02 UTC
[Win32utils-devel] Need some help with latest win32-mmap
Hi all, I''ve got the latest win32-mmap code checked into CVS. Unfortunately, it seems that I''m not able to open an existing mapping and retrieve set data. Below is a simple example that seems like it ought to work but doesn''t. Any ideas? # map1.rb require ''win32/mmap'' include Win32 mmap = MMap.new(:name => ''alpha'', :size => 20) p mmap.address mmap.test = "hello" mmap.close # map2.rb # mmap = MMap.open(''alpha'') # Boom! mmap = MMap.new(:name => ''alpha'', :size => 20) # Ok so far... p mmap.test # Boom! mmap.close I tried using MMap.open and MMap.new. Neither seems to work as expected. What am I doing wrong? Thanks, Dan PS - The code that actually gets and sets shared data is in method_missing.
Heesob Park
2006-Oct-09 05:02 UTC
[Win32utils-devel] Need some help with latest win32-mmap
Hi, 2006/10/7, Daniel Berger <djberg96 at gmail.com>:> > Hi all, > > I''ve got the latest win32-mmap code checked into CVS. Unfortunately, it > seems that I''m not able to open an existing mapping and retrieve set > data. Below is a simple example that seems like it ought to work but > doesn''t. Any ideas? > > # map1.rb > require ''win32/mmap'' > include Win32 > > mmap = MMap.new(:name => ''alpha'', :size => 20) > p mmap.address > > mmap.test = "hello" > > mmap.close > > # map2.rb > # mmap = MMap.open(''alpha'') # Boom! > > mmap = MMap.new(:name => ''alpha'', :size => 20) # Ok so far... > p mmap.test # Boom! > > mmap.close > > I tried using MMap.open and MMap.new. Neither seems to work as > expected. What am I doing wrong?That''s strange. I downloaded and tested the win32-mmap and your map1.rb and map2.rb It runs ok and seems to work as expected. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061009/19f9e144/attachment.html
Daniel Berger
2006-Oct-09 20:47 UTC
[Win32utils-devel] Need some help with latest win32-mmap
Heesob Park wrote:> Hi, > > 2006/10/7, Daniel Berger <djberg96 at gmail.com <mailto:djberg96 at gmail.com>>: > > Hi all, > > I''ve got the latest win32-mmap code checked into CVS. Unfortunately, it > seems that I''m not able to open an existing mapping and retrieve set > data. Below is a simple example that seems like it ought to work but > doesn''t. Any ideas? > > # map1.rb > require ''win32/mmap'' > include Win32 > > mmap = MMap.new(:name => ''alpha'', :size => 20) > p mmap.address > > mmap.test = "hello" > > mmap.close > > # map2.rb > # mmap = MMap.open(''alpha'') # Boom! > > mmap = MMap.new(:name => ''alpha'', :size => 20) # Ok so far... > p mmap.test # Boom! > > mmap.close > > I tried using MMap.open and MMap.new. Neither seems to work as > expected. What am I doing wrong? > > > That''s strange. > I downloaded and tested the win32-mmap and your map1.rb and map2.rb > It runs ok and seems to work as expected. > > Regards, > > Park HeesobReally? When you run map2.rb you see "hello"? When I run map2.rb I get the same address. But when I run map2.rb I get an error at mmap.rb, line 270: ''load - marshal data too short''. It seems that I''m getting an empty buffer from the memcpy, but I don''t understand why. I just tried this at work, too - same result. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Heesob Park
2006-Oct-10 02:02 UTC
[Win32utils-devel] Need some help with latest win32-mmap
Hi, 2006/10/10, Daniel Berger <Daniel.Berger at qwest.com>:> Heesob Park wrote: > > Hi, > > > > 2006/10/7, Daniel Berger <djberg96 at gmail.com <mailto:djberg96 at gmail.com > >>: > > > > Hi all, > > > > I''ve got the latest win32-mmap code checked into > CVS. Unfortunately, it > > seems that I''m not able to open an existing mapping and retrieve set > > data. Below is a simple example that seems like it ought to work > but > > doesn''t. Any ideas? > > > > # map1.rb > > require ''win32/mmap'' > > include Win32 > > > > mmap = MMap.new(:name => ''alpha'', :size => 20) > > p mmap.address > > > > mmap.test = "hello" > > > > mmap.close > > > > # map2.rb > > # mmap = MMap.open(''alpha'') # Boom! > > > > mmap = MMap.new(:name => ''alpha'', :size => 20) # Ok so far... > > p mmap.test # Boom! > > > > mmap.close > > > > I tried using MMap.open and MMap.new. Neither seems to work as > > expected. What am I doing wrong? > > > > > > That''s strange. > > I downloaded and tested the win32-mmap and your map1.rb and map2.rb > > It runs ok and seems to work as expected. > > > > Regards, > > > > Park Heesob > > Really? When you run map2.rb you see "hello"? > > When I run map2.rb I get the same address. But when I run map2.rb I get > an > error at mmap.rb, line 270: ''load - marshal data too short''. It seems > that I''m > getting an empty buffer from the memcpy, but I don''t understand why. > > I just tried this at work, too - same result.As a matter of fact I modified map1.rb like this: require ''win32/mmap'' include Win32 mmap = MMap.new(:name => ''alpha'', :size => 20) p mmap.address mmap.test = "hello" sleep 1000 mmap.close And run map1.rb in one console and run map2.rb in another console. When running map2.rb only, I also get "marshal data too short" error. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061010/a0585682/attachment.html
Johan Nilsson
2006-Oct-10 06:51 UTC
[Win32utils-devel] Need some help with latest win32-mmap
Hi,> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Daniel Berger > Sent: den 6 oktober 2006 22:03 > To: win32utils-devel at rubyforge.org > Subject: [Win32utils-devel] Need some help with latest win32-mmap > > Hi all, > > I''ve got the latest win32-mmap code checked into CVS. > Unfortunately, it seems that I''m not able to open an existing > mapping and retrieve set data. Below is a simple example > that seems like it ought to work but doesn''t. Any ideas? > > # map1.rb > require ''win32/mmap'' > include Win32 > > mmap = MMap.new(:name => ''alpha'', :size => 20) p mmap.address > > mmap.test = "hello" > > mmap.close > > # map2.rb > # mmap = MMap.open(''alpha'') # Boom! > > mmap = MMap.new(:name => ''alpha'', :size => 20) # Ok so far... > p mmap.test # Boom! > > mmap.close > > I tried using MMap.open and MMap.new. Neither seems to work > as expected. What am I doing wrong?I haven''t checked the implementation and this is probably too obvious to be the culprit, but: If map1.rb runs to completion and closes the mmap before map2.rb can attach by opening it, the memory map won''t exist unless you are using something else than the paging file as backing storage. The Win32 mmaps are reference counted through their handles as pretty much everything else. Also, as you can see it that using MMap.new from map2.rb works as the first step, but as this only creates a new identically named mmap there is no ''test'' data there. Hence the ''boom'' I''d guess. HTH, Johan Nilsson
Berger, Daniel
2006-Oct-10 13:43 UTC
[Win32utils-devel] Need some help with latest win32-mmap
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Johan Nilsson > Sent: Tuesday, October 10, 2006 12:51 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > Hi, > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > > Daniel Berger > > Sent: den 6 oktober 2006 22:03 > > To: win32utils-devel at rubyforge.org > > Subject: [Win32utils-devel] Need some help with latest win32-mmap > > > > Hi all, > > > > I''ve got the latest win32-mmap code checked into CVS. > > Unfortunately, it seems that I''m not able to open an existing > > mapping and retrieve set data. Below is a simple example > > that seems like it ought to work but doesn''t. Any ideas? > > > > # map1.rb > > require ''win32/mmap'' > > include Win32 > > > > mmap = MMap.new(:name => ''alpha'', :size => 20) p mmap.address > > > > mmap.test = "hello" > > > > mmap.close > > > > # map2.rb > > # mmap = MMap.open(''alpha'') # Boom! > > > > mmap = MMap.new(:name => ''alpha'', :size => 20) # Ok so far... p > > mmap.test # Boom! > > > > mmap.close > > > > I tried using MMap.open and MMap.new. Neither seems to work > > as expected. What am I doing wrong? > > I haven''t checked the implementation and this is probably too > obvious to be the culprit, but: > > If map1.rb runs to completion and closes the mmap before > map2.rb can attach by opening it, the memory map won''t exist > unless you are using something else than the paging file as > backing storage. The Win32 mmaps are reference counted > through their handles as pretty much everything else. > > Also, as you can see it that using MMap.new from map2.rb > works as the first step, but as this only creates a new > identically named mmap there is no ''test'' data there. Hence > the ''boom'' I''d guess. > > HTH, > > Johan NilssonYes, you and Heesob are both right. I was thinking the value stayed resident. Once I stuck a sleep call in there and ran it from a second terminal it worked fine. Duh. In other news, it looks like I need to set a default size for MMap.open. What sounds reasonabl? 1k? Thanks, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Johan Nilsson
2006-Oct-11 07:13 UTC
[Win32utils-devel] Need some help with latest win32-mmap
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Berger, Daniel > Sent: den 10 oktober 2006 15:43 > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of Johan > > Nilsson > > Sent: Tuesday, October 10, 2006 12:51 AM > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Need some help with latest > win32-mmap[snip]> > I haven''t checked the implementation and this is probably > too obvious > > to be the culprit, but: > > > > If map1.rb runs to completion and closes the mmap before > map2.rb can > > attach by opening it, the memory map won''t exist unless you > are using > > something else than the paging file as backing storage. The Win32 > > mmaps are reference counted through their handles as pretty much > > everything else. > > > > Also, as you can see it that using MMap.new from map2.rb > works as the > > first step, but as this only creates a new identically named mmap > > there is no ''test'' data there. Hence the ''boom'' I''d guess. > > > > HTH, > > > > Johan Nilsson > > Yes, you and Heesob are both right. I was thinking the value > stayed resident. Once I stuck a sleep call in there and ran > it from a second terminal it worked fine. Duh. > > In other news, it looks like I need to set a default size for > MMap.open. > What sounds reasonabl? 1k?I haven''t tried this myself, and judging from the MSDN docs it''s also not entirely clear that it will work, but: Try using zero(0) as the size when calling MapViewOfFile, and then use VirtualQuery to retrieve the size of the view. If you want to persist the values, use a file as the backing store (could be an optional feature, e.g. :name => ''/path/to/filename'' ). Oh, and use the "Global\" prefix for map names if you intend to share the data between different terminal server sessions (Win2k and upwards). But I guess you already do that internally. Regards / Johan
Berger, Daniel
2006-Oct-11 15:06 UTC
[Win32utils-devel] Need some help with latest win32-mmap
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Johan Nilsson > Sent: Wednesday, October 11, 2006 1:13 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap<snip>> > > > In other news, it looks like I need to set a default size for > > MMap.open. > > What sounds reasonabl? 1k? > > I haven''t tried this myself, and judging from the MSDN docs it''s also > not entirely clear that it will work, but: Try using zero(0) > as the size > when calling MapViewOfFile, and then use VirtualQuery to retrieve the > size of the view.Actually, I changed MMap.open to accept a hash of options that''s simply forwarded on to MMap.new (though the name is still a required argument), so you can specify the size that way. However, I think you''re right and, if it''s possible, I''ll do a VirtualQuery() to try to get the size of the view when MMap.open is used if a size isn''t specified explicitly. That seems like a much friendlier way to go. :)> If you want to persist the values, use a file as the backing store > (could be an optional feature, e.g. :name => ''/path/to/filename'' ).Well, there is a separate :file option. I''m not sure I want to try to guess whether :name refers to a file or not. Or have I misunderstood?> Oh, and use the "Global\" prefix for map names if you intend to share > the data between different terminal server sessions (Win2k > and upwards). > But I guess you already do that internally.It will be up to the programmer to know details like that for the :name option, though I can copy/paste the relevant section out of the MSDN docs. Thanks for the feedback. - Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Berger, Daniel
2006-Oct-11 18:39 UTC
[Win32utils-devel] Need some help with latest win32-mmap
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Johan Nilsson > Sent: Wednesday, October 11, 2006 1:13 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap<snip>> I haven''t tried this myself, and judging from the MSDN docs it''s also > not entirely clear that it will work, but: Try using zero(0) > as the size > when calling MapViewOfFile, and then use VirtualQuery to retrieve the > size of the view.I''ve been tinkering with this a bit. I think I''m doing something wrong. Here''s a private method I created to get the view size. Note that this requires modifying the "VirtualQuery" (in windows/memory.rb) method signature to "LPL": def get_view_size mbi = [0,0,0,0,0,0,0].pack(''LLLLLLL'') # MEMORY_BASIC_INFORMATION VirtualQuery(@base_address, mbi, mbi.size) return mbi[12,4].unpack(''L'').first # RegionSize end Then, in MMap.new, I have this: if @open size = get_view_size() @address = MapViewOfFileEx(@mh, @access, 0, 0, size, @base_address) else @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) end The first issue, I think, is that get_view_size always returns 65536 (64k). I''m guessing 64k is a default amount of memory to allocate or something. Using the examples I provided previously, I would expect this to be 20. The second issue is that MapViewOfFileEx fails if I try to pass a size. I think I''m misreading the docs. I''d make some more commits so you could just check this out from RubyForge, but I''m getting timeouts at the moment from rubyforge.org... Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
Heesob Park
2006-Oct-12 01:09 UTC
[Win32utils-devel] Need some help with latest win32-mmap
Hi, 2006/10/12, Berger, Daniel <Daniel.Berger at qwest.com>:> > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > > Johan Nilsson > > Sent: Wednesday, October 11, 2006 1:13 AM > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > <snip> > > > I haven''t tried this myself, and judging from the MSDN docs it''s also > > not entirely clear that it will work, but: Try using zero(0) > > as the size > > when calling MapViewOfFile, and then use VirtualQuery to retrieve the > > size of the view. > > I''ve been tinkering with this a bit. I think I''m doing something wrong. > Here''s a private method I created to get the view size. Note that this > requires modifying the "VirtualQuery" (in windows/memory.rb) method > signature to "LPL": > > def get_view_size > mbi = [0,0,0,0,0,0,0].pack(''LLLLLLL'') # MEMORY_BASIC_INFORMATION > VirtualQuery(@base_address, mbi, mbi.size) > return mbi[12,4].unpack(''L'').first # RegionSize > endshould be: def get_view_size mbi = [0,0,0,0,0,0,0].pack(''LLLLLLL'') # MEMORY_BASIC_INFORMATION VirtualQuery(@address, mbi, mbi.size) return mbi[12,4].unpack(''L'').first # RegionSize end Then, in MMap.new, I have this:> > if @open > size = get_view_size() > @address = MapViewOfFileEx(@mh, @access, 0, 0, size, @base_address) > else > @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) > endshould be: if @open @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) @size = get_view_size() else @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) end The first issue, I think, is that get_view_size always returns 65536> (64k). I''m guessing 64k is a default amount of memory to allocate or > something. Using the examples I provided previously, I would expect > this to be 20. > > The second issue is that MapViewOfFileEx fails if I try to pass a size. > I think I''m misreading the docs. > > I''d make some more commits so you could just check this out from > RubyForge, but I''m getting timeouts at the moment from rubyforge.org... > > Regards, > > DanIt seems the memory map in windows aligns 4k boundary. When created with 20, get_view_size returns 4096 When created with 20000, get_view_size returns 20480. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061012/ce212b83/attachment.html
Daniel Berger
2006-Oct-12 03:18 UTC
[Win32utils-devel] Need some help with latest win32-mmap
On 10/11/06, Heesob Park <phasis at gmail.com> wrote:> > Hi, > > 2006/10/12, Berger, Daniel <Daniel.Berger at qwest.com>: > > > > > -----Original Message----- > > > From: win32utils-devel-bounces at rubyforge.org > > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > > > Johan Nilsson > > > Sent: Wednesday, October 11, 2006 1:13 AM > > > To: Development and ideas for win32utils projects > > > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > > <snip> > > > > > I haven''t tried this myself, and judging from the MSDN docs it''s also > > > not entirely clear that it will work, but: Try using zero(0) > > > as the size > > > when calling MapViewOfFile, and then use VirtualQuery to retrieve the > > > size of the view. > > > > I''ve been tinkering with this a bit. I think I''m doing something wrong. > > Here''s a private method I created to get the view size. Note that this > > requires modifying the "VirtualQuery" (in windows/memory.rb) method > > signature to "LPL": > > > > def get_view_size > > mbi = [0,0,0,0,0,0,0].pack(''LLLLLLL'') # MEMORY_BASIC_INFORMATION > > VirtualQuery(@base_address, mbi, mbi.size) > > return mbi[12,4].unpack(''L'').first # RegionSize > > end > > > should be: > > def get_view_size > mbi = [0,0,0,0,0,0,0].pack(''LLLLLLL'') # MEMORY_BASIC_INFORMATION > VirtualQuery(@address, mbi, mbi.size) > return mbi[12,4].unpack(''L'').first # RegionSize > end > > > Then, in MMap.new, I have this: > > > > if @open > > size = get_view_size() > > @address = MapViewOfFileEx(@mh, @access, 0, 0, size, @base_address) > > else > > @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) > > end > > > should be: > > if @open > @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) > @size = get_view_size() > else > @address = MapViewOfFileEx(@mh, @access, 0, 0, 0, @base_address) > end > > > The first issue, I think, is that get_view_size always returns 65536 > > (64k). I''m guessing 64k is a default amount of memory to allocate or > > something. Using the examples I provided previously, I would expect > > this to be 20. > > > > The second issue is that MapViewOfFileEx fails if I try to pass a size. > > I think I''m misreading the docs. > > > > I''d make some more commits so you could just check this out from > > RubyForge, but I''m getting timeouts at the moment from rubyforge.org... > > > > Regards, > > > > Dan > > > It seems the memory map in windows aligns 4k boundary. > When created with 20, get_view_size returns 4096 > When created with 20000, get_view_size returns 20480. > > Regards, > > Park Heesob >Many thanks. I have checked the changes into CVS, along with the semaphore locking code. All, please take a look and let me know if you think I''m missing anything or if there are any other interface changes you think need to be made. I wasn''t sure about the method_missing approach, but I think it''s nicer than the old getvar/setvar approach. I can always add that back in if necessary. If all looks good, I''ll try to get a release out this weekend. Regards, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/win32utils-devel/attachments/20061011/9dddc674/attachment.html
Johan Nilsson
2006-Oct-12 06:45 UTC
[Win32utils-devel] Need some help with latest win32-mmap
> From: win32utils-devel-bounces at rubyforge.org[mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of Heesob Park> Sent: den 12 oktober 2006 03:09 > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latestwin32-mmap>[snip]> It seems the memory map in windows aligns 4k boundary. > When created with 20, get_view_size returns 4096 > When created with 20000, get_view_size returns 20480.Actually, it aligns to the nearest page boundary (which is not necessarily 4k). Use GetSystemInformation to retrieve SYSTEM_INFO (dwPageSize member). / Johan
Johan Nilsson
2006-Oct-12 06:48 UTC
[Win32utils-devel] Need some help with latest win32-mmap
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Berger, Daniel > Sent: den 11 oktober 2006 17:06 > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > -----Original Message----- > > From: win32utils-devel-bounces at rubyforge.org > > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of Johan > > Nilsson > > Sent: Wednesday, October 11, 2006 1:13 AM > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Need some help with latest > win32-mmap[snip]> > > If you want to persist the values, use a file as the backing store > > (could be an optional feature, e.g. :name => ''/path/to/filename'' ). > > Well, there is a separate :file option. I''m not sure I want > to try to guess whether :name refers to a file or not. Or > have I misunderstood?I''m sorry - I only replied using the information in previous mails. Haven''t actually tried to use mmap or check out the examples. / Johan
Berger, Daniel
2006-Oct-12 13:41 UTC
[Win32utils-devel] Need some help with latest win32-mmap
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Johan Nilsson > Sent: Thursday, October 12, 2006 12:46 AM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Need some help with latest win32-mmap > > > > > From: win32utils-devel-bounces at rubyforge.org > [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of > Heesob Park > > Sent: den 12 oktober 2006 03:09 > > To: Development and ideas for win32utils projects > > Subject: Re: [Win32utils-devel] Need some help with latest > win32-mmap > > > > [snip] > > > > It seems the memory map in windows aligns 4k boundary. > > When created with 20, get_view_size returns 4096 > > When created with 20000, get_view_size returns 20480. > > Actually, it aligns to the nearest page boundary (which is > not necessarily 4k). Use GetSystemInformation to retrieve > SYSTEM_INFO (dwPageSize member).Right, I''ll note that in the docs, thanks. - Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.