R
RJ
I am decompiling some data from my C code which can be used by Perl
programs later on. My Data structure is something like follows -
struct tDs{
char *tName;
int *data;
}
struct DS{
int index;
char *rName;
<list> tDs;
}
I am decompiling above data in a perl file (which I generate from C
code) as follows
<generated_file.pl>
pass_data_from_perl_to_c (index1,rName,{"tName1" => "data1" , "tName2"
=> "data2"});
The last argument in above function call is a hasg referemce to list
of values associated with various objects of type tDs for index
index1.
First of all, if I just do a `require "<generated_file.pl>" ` it takes
a lot of memory (around 4Mb for 2 Mb file even if I do just a return
after entering pass_data_from_perl_to_c and populate no Data).
If I do populate data in form of 3-D array is perl memory requirement
is 5 times than expected.
Can someone Please explain me why this is so and how I can avoid
spending unnecessary memory taken by require.
Waiting for a quick reply.
-RJ
programs later on. My Data structure is something like follows -
struct tDs{
char *tName;
int *data;
}
struct DS{
int index;
char *rName;
<list> tDs;
}
I am decompiling above data in a perl file (which I generate from C
code) as follows
<generated_file.pl>
pass_data_from_perl_to_c (index1,rName,{"tName1" => "data1" , "tName2"
=> "data2"});
The last argument in above function call is a hasg referemce to list
of values associated with various objects of type tDs for index
index1.
First of all, if I just do a `require "<generated_file.pl>" ` it takes
a lot of memory (around 4Mb for 2 Mb file even if I do just a return
after entering pass_data_from_perl_to_c and populate no Data).
If I do populate data in form of 3-D array is perl memory requirement
is 5 times than expected.
Can someone Please explain me why this is so and how I can avoid
spending unnecessary memory taken by require.
Waiting for a quick reply.
-RJ