++ed by:
ABRAXXA ADAMJS ALEXBIO ANDREFS ARJONES

118 PAUSE user(s)
93 non-PAUSE user(s).

Ricardo SIGNES

Pad Data Structures */

/* offsets within a pad */

#if PTRSIZE == 4 typedef U32TYPE PADOFFSET; #else # if PTRSIZE == 8 typedef U64TYPE PADOFFSET; # endif #endif #define NOT_IN_PAD ((PADOFFSET) -1)

struct padlist { SSize_t xpadl_max; /* max index for which array has space */ PAD ** xpadl_alloc; /* pointer to beginning of array of AVs */ PADNAMELIST*xpadl_outid; /* Padnamelist of outer pad; used as ID */ };

/* a value that PL_cop_seqmax is guaranteed never to be, * flagging that a lexical is being introduced, or has not yet left scope */ #define PERL_PADSEQ_INTRO U32_MAX

/* B.xs needs these for the benefit of B::Deparse */ /* Low range end is exclusive (valid from the cop seq after this one) */ /* High range end is inclusive (valid up to this cop seq) */

#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) # define COP_SEQ_RANGE_LOW(sv) \ (({ const SV *const _sv_cop_seq_range_low = (const SV *) (sv); \ assert(SvTYPE(_sv_cop_seq_range_low) == SVt_NV \ || SvTYPE(_sv_cop_seq_range_low) >= SVt_PVNV); \ assert(SvTYPE(_sv_cop_seq_range_low) != SVt_PVAV); \ assert(SvTYPE(_sv_cop_seq_range_low) != SVt_PVHV); \ assert(SvTYPE(_sv_cop_seq_range_low) != SVt_PVCV); \ assert(SvTYPE(_sv_cop_seq_range_low) != SVt_PVFM); \ assert(!isGV_with_GP(_sv_cop_seq_range_low)); \ ((XPVNV*) MUTABLE_PTR(SvANY(_sv_cop_seq_range_low)))->xnv_u.xpad_cop_seq.xlow; \ })) # define COP_SEQ_RANGE_HIGH(sv) \ (({ const SV *const _sv_cop_seq_range_high = (const SV *) (sv); \ assert(SvTYPE(_sv_cop_seq_range_high) == SVt_NV \ || SvTYPE(_sv_cop_seq_range_high) >= SVt_PVNV); \ assert(SvTYPE(_sv_cop_seq_range_high) != SVt_PVAV); \ assert(SvTYPE(_sv_cop_seq_range_high) != SVt_PVHV); \ assert(SvTYPE(_sv_cop_seq_range_high) != SVt_PVCV); \ assert(SvTYPE(_sv_cop_seq_range_high) != SVt_PVFM); \ assert(!isGV_with_GP(_sv_cop_seq_range_high)); \ ((XPVNV*) MUTABLE_PTR(SvANY(_sv_cop_seq_range_high)))->xnv_u.xpad_cop_seq.xhigh; \ })) # define PARENT_PAD_INDEX(sv) \ (({ const SV *const _sv_parent_pad_index = (const SV *) (sv); \ assert(SvTYPE(_sv_parent_pad_index) == SVt_NV \ || SvTYPE(_sv_parent_pad_index) >= SVt_PVNV); \ assert(SvTYPE(_sv_parent_pad_index) != SVt_PVAV); \ assert(SvTYPE(_sv_parent_pad_index) != SVt_PVHV); \ assert(SvTYPE(_sv_parent_pad_index) != SVt_PVCV); \ assert(SvTYPE(_sv_parent_pad_index) != SVt_PVFM); \ assert(!isGV_with_GP(_sv_parent_pad_index)); \ ((XPVNV*) MUTABLE_PTR(SvANY(_sv_parent_pad_index)))->xnv_u.xpad_cop_seq.xlow; \ })) # define PARENT_FAKELEX_FLAGS(sv) \ (({ const SV *const _sv_parent_fakelex_flags = (const SV *) (sv); \ assert(SvTYPE(_sv_parent_fakelex_flags) == SVt_NV \ || SvTYPE(_sv_parent_fakelex_flags) >= SVt_PVNV); \ assert(SvTYPE(_sv_parent_fakelex_flags) != SVt_PVAV); \ assert(SvTYPE(_sv_parent_fakelex_flags) != SVt_PVHV); \ assert(SvTYPE(_sv_parent_fakelex_flags) != SVt_PVCV); \ assert(SvTYPE(_sv_parent_fakelex_flags) != SVt_PVFM); \ assert(!isGV_with_GP(_sv_parent_fakelex_flags)); \ ((XPVNV*) MUTABLE_PTR(SvANY(_sv_parent_fakelex_flags)))->xnv_u.xpad_cop_seq.xhigh; \ })) #else # define COP_SEQ_RANGE_LOW(sv) \ (0 + (((XPVNV*) SvANY(sv))->xnv_u.xpad_cop_seq.xlow)) # define COP_SEQ_RANGE_HIGH(sv) \ (0 + (((XPVNV*) SvANY(sv))->xnv_u.xpad_cop_seq.xhigh))

# define PARENT_PAD_INDEX(sv) \ (0 + (((XPVNV*) SvANY(sv))->xnv_u.xpad_cop_seq.xlow)) # define PARENT_FAKELEX_FLAGS(sv) \ (0 + (((XPVNV*) SvANY(sv))->xnv_u.xpad_cop_seq.xhigh)) #endif

/* Flags set in the SvIVX field of FAKE namesvs */

#define PAD_FAKELEX_ANON 1 /* the lex is declared in an ANON, or ... */ #define PAD_FAKELEX_MULTI 2 /* the lex can be instantiated multiple times */

/* flags for the pad_new() function */

#define padnew_CLONE 1 /* this pad is for a cloned CV */ #define padnew_SAVE 2 /* save old globals */ #define padnew_SAVESUB 4 /* also save extra stuff for start of sub */

/* values for the pad_tidy() function */

typedef enum { padtidy_SUB, /* tidy up a pad for a sub, */ padtidy_SUBCLONE, /* a cloned sub, */ padtidy_FORMAT /* or a format */ } padtidy_type;

/* flags for pad_add_name_pvn. */

#define padadd_OUR 0x01 /* our declaration. */ #define padadd_STATE 0x02 /* state declaration. */ #define padadd_NO_DUP_CHECK 0x04 /* skip warning on dups. */ #define padadd_STALEOK 0x08 /* allow stale lexical in active * sub, but only one level up */ #define padadd_UTF8_NAME SVf_UTF8 /* name is UTF-8 encoded. */

/* ASSERT_CURPAD_LEGAL and ASSERT_CURPAD_ACTIVE respectively determine * whether PL_comppad and PL_curpad are consistent and whether they have * active values */

#ifndef PERL_MAD # define pad_peg(label) #endif

#ifdef DEBUGGING # define ASSERT_CURPAD_LEGAL(label) \ pad_peg(label); \ if (PL_comppad ? (AvARRAY(PL_comppad) != PL_curpad) : (PL_curpad != 0)) \ Perl_croak(aTHX_ "panic: illegal pad in %s: 0x%"UVxf"[0x%"UVxf"]",\ label, PTR2UV(PL_comppad), PTR2UV(PL_curpad));

# define ASSERT_CURPAD_ACTIVE(label) \ pad_peg(label); \ if (!PL_comppad || (AvARRAY(PL_comppad) != PL_curpad)) \ Perl_croak(aTHX_ "panic: invalid pad in %s: 0x%"UVxf"[0x%"UVxf"]",\ label, PTR2UV(PL_comppad), PTR2UV(PL_curpad)); #else # define ASSERT_CURPAD_LEGAL(label) # define ASSERT_CURPAD_ACTIVE(label) #endif

/* Note: the following three macros are actually defined in scope.h, but * they are documented here for completeness, since they directly or * indirectly affect pads.

XXX DAPM it would make more sense to make the arg a PADOFFSET =for apidoc m|void|SAVECLEARSV |SV **svp Clear the pointed to pad value on scope exit. (i.e. the runtime action of 'my')

    SAVECOMPPAD();
    PAD_SET_CUR_NOSAVE(padlist,n);

Exactly like "pad_add_name_pvn", but takes a literal string instead of a string/length pair.

Exactly like "pad_findmy_pvn", but takes a literal string instead of a string/length pair.




Hosting generously
sponsored by Bytemark