Pman has asked for the wisdom of the Perl Monks concerning the following question:

Heyy Monks! Any help is very much appreciated. I am trying out a module called Tie::Array::Pointer.

I set it up as follows:
...
$PtrMemoryMap= from MapViewOfFile in kernel32.dll
...
tie @buffer, 'Tie::Array::Pointer', {
length => $nSizeOfMemoryMappedFile,
type => 'S',
address => \$PtrMemoryMap,
};

Basically I am trying to assign a memory mapped file to this array. This works in linux without a problem when using sysopen and memmap2 to set up the map. In win32, the app blows up when i try to do stuff with the array. I wonder if anyone used this Tie Array Pointer in windows and had the same problem?

Replies are listed 'Best First'.
Re: Program crash using c pointer
by Corion (Patriarch) on Jun 04, 2009 at 06:45 UTC

    I don't see anything immediately that would make this a problem in principle with Tie::Array::Pointer or MapViewOfFile, so if you can post a self-contained program that exhibits the problem, maybe we can investigate further.