http://qs1969.pair.com?node_id=524937

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

Hi monks,
I am using perlembed for calling perl subroutines from C . I need to pass huge files (around 1Mb) from C to perl. The files are stored in character buffers .char *htmFile .The "htmFile" variable holds the entire file content.

I use "call_pv" for calling perl subroutines from C after pushing the arguments onto perl stack using "xPUSHs". I want to know is there any way by which i could pass the char pointer to perl and use it as a reference in perl. I cannot pass the entire buffer using XPUSHs(sv_2mortal(newSVpvn(htmFile)))
as the perl stack is creating problems(SEG fault) when the file size is around 64kb.What could be the possible reason for this?. Could any of the esteemed monks tell me an efficient manner to pass the huge file to perl? (ofcourse without storing it in harddisk in C and accesing from perl)

Thanks,
Kiran.