The stupid question is the question not asked | |
PerlMonks |
Re^2: What difference between malloc and Newx, how attach a C string to SV directly?by xiaoyafeng (Deacon) |
on Sep 29, 2019 at 08:08 UTC ( [id://11106829]=note: print w/replies, xml ) | Need Help?? |
Note how Perl considers the buffer to belong to Perl now. yeah, if buf produced from malloc which means it's not belong to perl, program will throw a segment fault error. I guess Newx maybe not just a simple wrap of malloc, it does a register pointer address to perl when which assure perl could free it safely. I think there is a way to have a PV be a pointer to memory that is not free'd by Perl, but... yes, I think it too, that's why I post question on perlmonks. ;)I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction
In Section
Seekers of Perl Wisdom
|
|