I'll repeat my previous advice. Don't use T_OBJPTR. Instead, have your XS code deal with very simple C data types and do all of the object creation/destruction in wrapper methods written in Perl (as part of your module).
The reason I advise this is exactly because XS code is so easy to get wrong and so hard to debug.
andsub new { my $ptr= xs_new( ... ); bless \$ptr, ...; } sub DESTROY { my $self= shift(@_); xs_free( $$self ); }
- tyeint xs_new( ... ) WHATEVER* pObj= ...; RETVAL= (int)pObj; void xs_free( self ) int self CODE: free( (void *)self );
In reply to Re: panic: leave_scope inconsistency. (need help creating Tie::PureDB) (less XS)
by tye
in thread panic: leave_scope inconsistency. (need help creating Tie::PureDB)
by PodMaster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |