void addBs(SV *a_sv, std::vector &b_svs) { SV *tmpSv; I32 count; std::vector::iterator iter; dSP; ENTER; SAVETMPS; PUSHMARK(SP); tmpSv = sv_mortalcopy(a_sv); XPUSHs(tmpSv); for (iter = b_svs.begin( ); iter != b_svs.end( ); ++iter) { XPUSHs(sv_2mortal(*iter)); } PUTBACK; count = call_method("add", G_VOID|G_DISCARD); // A::add { // my $this = shift; // push(@{$this->{B}}, @_); // } SPAGAIN; assert(0 == count); FREETMPS; LEAVE; }