On Thu, Apr 14, 2005 at 06:33:17PM -0400 Scott Lanning wrote:
> On Thu, 14 Apr 2005, Tassilo von Parseval wrote:
> >On Thu, Apr 14, 2005 at 02:24:36PM -0400 Scott Lanning wrote:
> >>but for example how do you deal with passing values
> >>into methods by reference? The ampersand (&) has a special
> >>meaning for XSUB arguments.
> >
> >I don't know anything about the special meaning of ampersands in XSUB
> >arguments. Is that mentioned somewhere in the docs?
> 
> In `perlxs` and `perlxstut`, search for "semantic"
> (there's a typo in perlxstut).

Oh, right, I get it. I think I would have had use for that in the past.
But I doubt that this can be used for C++ references on objects.

Well, one day we'll all be using "handles" anyway. :-)

http://www.intel.com/cd/ids/developer/asmo-na/eng/os/windows/96667.htm?page=3

> >Other than that, C++
> >references are probably best avoided. It severely collides with perl's
> >garbage-collecting when you use C++'s default memory allocator and then
> >pass references to this object around. So the only safe way is to use
> >'new' and pass the pointer instead of the reference. C++ wont mind.
> 
> Might explain a certain segfault I was screaming at last night...
> That's a good idea, to wrap the pointer up in new.
> (Mozilla::DOM is the module I'm doing, if anyone's curious.)

Not really XS-related: I probably wouldn't generate the PODs dynamically
at install-time. The problem is that people can't get an idea of the API
of the module when by around search.cpan.org. For me, the module's
documentation is the main criterion for trying out or not trying out a
new module.

Tassilo
-- 
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);

Reply via email to