Hi all,

I met a problem when I use Perl script to call a C function. A scalar
variable in Perl script is passed as an input parameter to the C function.
In the C function, it'll be used as a pointer, and the memory block it
points to will be used to store some data read from another structure. Tests
shows when memory block can't hold more than 24KB, if more than 24KB is
attempt to write to that memory block (pointed by the pointer in C, and the
scalar variable in Perl), a "segmentation fault" in the C function occurs.

I think there must be a limit for the size of a contiguous memory block
assigned to a perl scalar variable. The point is, how to assign a desired
size (e.g., 64KB) of memory block to the scalar variable in Perl? Like the
use of malloc in C?

-- 
Best regards,
Yang Zhou
------------------------------------------------------------------
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

Reply via email to