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).


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.)

Reply via email to