cvs commit: ponie/perl sv.c

[email protected] (Nicholas Clark) 30 Apr 2005 22:03:15 -0000
Newsgroups perl.ponie.changes
Message-ID <[email protected]>
cvsuser     05/04/30 15:03:14

  Modified:    perl     sv.c
  Log:
  Access SvANY via a PMC method call rather than getting the pointer and
  assuming that that points to a SV head structure.
  
  Revision  Changes    Path
  1.72      +10 -2     ponie/perl/sv.c
  
  Index: sv.c
  ===================================================================
  RCS file: /cvs/public/ponie/perl/sv.c,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- sv.c	30 Apr 2005 19:28:02 -0000	1.71
  +++ sv.c	30 Apr 2005 22:03:14 -0000	1.72
  @@ -1064,9 +1064,17 @@
   
   void**
   Perl_macro_SvANY (pTHX_ SV *sv) {
  -  return &(((struct STRUCT_SV*)Parrot_PMC_get_pointer(PL_Parrot,MUMBLE(sv)))
  -	   ->sv_any);
  +    /*
  +      This is likely to be faster, but it assumes that the PMC pointer is
  +      valid.
  +      This won't be the case for SVt_NULL for very long.
  +      return &(((struct STRUCT_SV*)Parrot_PMC_get_pointer(PL_Parrot,MUMBLE(sv)))->sv_any);
  +    */
  +    return (struct STRUCT_SV**)Parrot_PMC_get_pointer_intkey(PL_Parrot,
  +							     MUMBLE(sv),
  +							     Ponie_P_ANY);
   }
  +
   U32*
   S_macro_SvFLAGS_RW (pTHX_ SV *sv) {
     return &(((struct STRUCT_SV*)Parrot_PMC_get_pointer(PL_Parrot,MUMBLE(sv)))