Dear all,

If I populate an array with av_push will the SV* val a copy in the array or it is only a reference to it?
Because I use res1 = newSVpvn(tmp1, strlen(tmp1)); in a for to create the SV.
If it would be a copy than I could free res1 with sv_free()?


My code is this:
res = newAV();
lendata = strlen(data);
for(i=0;i<lendata;i++)
{
if(data[i]=='X' || data[i]=='O' || data[i]=='S' || data[i]=='C' || data[i]=='T')
{
hi = 0;
for(;i<lendata;i++) {
if(data[i] == ' ') {
tmp1[hi] = 0;
if(strlen(tmp1) > 2) {
res1 = newSVpvn(tmp1, strlen(tmp1));
SvPOK_on(res1);
// if(!check(res, res1)) {
av_push(res,res1);
// }
}
break;
} else {
tmp1[hi] = data[i];
}
hi++;
}
}
}


Thank you,
Reinhard
--



Reply via email to