develooper Front page | perl.perl5.porters | Postings from January 2013

Re: perl smokes with -DPERL_GLOBAL_STRUCT (or-DPERL_GLOBAL_STRUCT_PRIVATE)?

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
January 14, 2013 13:10
Subject:
Re: perl smokes with -DPERL_GLOBAL_STRUCT (or-DPERL_GLOBAL_STRUCT_PRIVATE)?
Message ID:
20130114130956.GF2044@iabyn.com
On Mon, Jan 14, 2013 at 12:53:02PM +0000, Nicholas Clark wrote:
> On Mon, Jan 14, 2013 at 07:46:11AM -0500, Jarkko Hietaniemi wrote:
> > On Monday-201301-14 7:35, Dave Mitchell wrote:
> 
> > Darn.  Foiled by my own former myself.  Do I get a prize?
> 
> A booby prize?

Perhaps $10 for every commit he's ever done ;-)

> > > which implies that SWIG at least does (or did) modify the vtable.
> 
> Check whether SWIG still does this? And if so, submit a patch? :-)

I just had a look at the swig-2.0.9 src code. The only reference to
MGVTBL is

    SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
    #endif
    {
      MAGIC *mg;
      sv_magic(sv,sv,'U',name,strlen(name));
      mg = mg_find(sv,'U');
      mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
      mg->mg_virtual->svt_get = (SwigMagicFunc) get;
      mg->mg_virtual->svt_set = (SwigMagicFunc) set;
      ...

which appears to mallocing its own vtable rather than modifying a system
one.

But I don't understand the code and may have missed something.


-- 
But Pity stayed his hand. "It's a pity I've run out of bullets",
he thought. -- "Bored of the Rings"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About