develooper Front page | perl.perl5.porters | Postings from February 2003

Re: New SV Flag

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
February 5, 2003 14:17
Subject:
Re: New SV Flag
Message ID:
20030205220900.GB281@Bagpuss.unfortu.net
On Mon, Feb 03, 2003 at 01:14:59AM +0100, Arthur Bergman wrote:
> Hi,
> 
> I would like a new SV flag, or SV flag combination that means, this SV 
> does not live on the arenas and should not be PL_sv_counted, a hint to 
> sv_free not to plant this sv again.

What do you mean plant? particularly with respect to sv_free?

> I would like all SVs that are living in the optree to be of this kind, 
> this would allow us to move constants out of the pad and let them be 
> PVMG so they can't be upgraded anymore, same applies for the 
> METHOD_NAMED SvPVIV.

I can't see any free flags. Which flags logically conflict with this - is
there a sane way to overload one?

If that fails, I can see a way to free up one flag bit - change

#define SVf_OOK		0x00200000	/* has valid offset value */
#define SvOOK(sv)		(SvFLAGS(sv) & SVf_OOK)

to

#define SVf_OOK		0x80000000	/* has valid offset value */
#define SvOOK(sv)		((SvFLAGS(sv) & (SVp_IOK|SVf_OOK)) == SVf_OOK)

because you can't be SVf_IVisUV:

#define SVf_IVisUV	0x80000000	/* use XPVUV instead of XPVIV */

without also being SVp_IOK

Nicholas Clark

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