How to use sv_dup_inc() ?
[email protected] (Tristan Darricau) Tue, 22 Jul 2014 10:17:28 +0200 (CEST)
| Newsgroups | perl.xs |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_4977609_1071510371.1406017048410 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, I am working on a XS module in which I have to transmit and share data between multiples contexts. To simplify, this system is constructed around two methods: - send(<name>, <data>) - receive(<name>) : <data> Send and receive are called from two different contexts and the destination context can't be known in advance. (I have the insurance that the data will be used in the destination context before the destruction of the sender context). In my initial code I have some problems of double free during the destruction of the contexts (panic: free from wrong pool). I think that I have to use sv_dup_inc() to solve this issue but I may have miss something because I get a Seg. fault in S_ptr_table_find (tbl=0x0, sv=0xa0b5a8) at sv.c:12197 So could you help me to find how to use sv_dup_inc() correctly? Thanks! Tristan ------=_Part_4977609_1071510371.1406017048410 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <html><body><div style=3D"font-family: times new roman, new york, times, se= rif; font-size: 12pt; color: #000000"><div>Hi,</div><div><br>I am working o= n a XS module in which I have to transmit and share data between multiples = contexts.<br>To simplify, this system is constructed around two methods:<br= > - send(<name>, <data>)<br> &nbs= p;- receive(<name>) : <data><br>Send and receive are called fro= m two different contexts and the destination context can't be known in adva= nce. </div><div>(I have the insurance that the data will be used in the des= tination context before the destruction of the sender context).</div><div><= br>In my initial code I have some problems of double free during the destru= ction of the contexts (panic: free from wrong pool). </div><div>I think tha= t I have to use sv_dup_inc() to solve this issue but I may have miss someth= ing because I get a Seg. fault in S_ptr_table_find (tbl=3D0x0, sv=3D0xa0b5a= 8) at sv.c:12197<br>So could you help me to find how to use sv_dup_inc() co= rrectly?<br><br>Thanks!<br>Tristan</div></div></body></html> ------=_Part_4977609_1071510371.1406017048410--