Skip to content

Commit

Permalink
Rearrange members of structures to reduce memory size on some
Browse files Browse the repository at this point in the history
platforms. On LP64 structs stackinfo, refcounted_he, and magic shrink
by 8 bytes, struct yy_parser by 16.

p4raw-id: //depot/perl@30817
  • Loading branch information
nwc10 committed Mar 31, 2007
1 parent b1225a1 commit 9bd8781
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cop.h
Expand Up @@ -748,11 +748,11 @@ L<perlcall>.
struct stackinfo {
AV * si_stack; /* stack for current runlevel */
PERL_CONTEXT * si_cxstack; /* context stack for runlevel */
struct stackinfo * si_prev;
struct stackinfo * si_next;
I32 si_cxix; /* current context index */
I32 si_cxmax; /* maximum allocated index */
I32 si_type; /* type of runlevel */
struct stackinfo * si_prev;
struct stackinfo * si_next;
I32 si_markoff; /* offset where markstack begins for us.
* currently used only with DEBUGGING,
* but not #ifdef-ed for bincompat */
Expand Down
10 changes: 5 additions & 5 deletions gv.h
Expand Up @@ -10,14 +10,14 @@

struct gp {
SV * gp_sv; /* scalar value */
U32 gp_refcnt; /* how many globs point to this? */
struct io * gp_io; /* filehandle value */
CV * gp_form; /* format value */
AV * gp_av; /* array value */
HV * gp_hv; /* hash value */
GV * gp_egv; /* effective gv, if *glob */
CV * gp_cv; /* subroutine value */
U32 gp_cvgen; /* generational validity of cached gv_cv */
U32 gp_refcnt; /* how many globs point to this? */
HV * gp_hv; /* hash value */
AV * gp_av; /* array value */
CV * gp_form; /* format value */
GV * gp_egv; /* effective gv, if *glob */
line_t gp_line; /* line first declared at (for -w) */
HEK * gp_file_hek; /* file first declared in (for -w) */
};
Expand Down
2 changes: 1 addition & 1 deletion hv.h
Expand Up @@ -403,13 +403,13 @@ struct refcounted_he {
#else
HEK *refcounted_he_hek; /* hint key */
#endif
U32 refcounted_he_refcnt; /* reference count */
union {
IV refcounted_he_u_iv;
UV refcounted_he_u_uv;
STRLEN refcounted_he_u_len;
void *refcounted_he_u_ptr; /* Might be useful in future */
} refcounted_he_val;
U32 refcounted_he_refcnt; /* reference count */
/* First byte is flags. Then NUL-terminated value. Then for ithreads,
non-NUL terminated key. */
char refcounted_he_data[1];
Expand Down
2 changes: 1 addition & 1 deletion mg.h
Expand Up @@ -30,9 +30,9 @@ struct magic {
U16 mg_private;
char mg_type;
U8 mg_flags;
I32 mg_len;
SV* mg_obj;
char* mg_ptr;
I32 mg_len;
};

#define MGf_TAINTEDDIR 1 /* PERL_MAGIC_envelem only */
Expand Down
4 changes: 2 additions & 2 deletions parser.h
Expand Up @@ -25,8 +25,8 @@ typedef struct yy_parser {
/* parser state */

struct yy_parser *old_parser; /* previous value of PL_parser */
int yychar; /* The lookahead symbol. */
YYSTYPE yylval; /* value of lookahead symbol, set by yylex() */
int yychar; /* The lookahead symbol. */

/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
Expand All @@ -47,9 +47,9 @@ typedef struct yy_parser {
int lex_expect; /* expect after determined token */
I32 lex_formbrack; /* bracket count at outer format level */
OP *lex_inpat; /* in pattern $) and $| are special */
I32 lex_inwhat; /* what kind of quoting are we in */
OP *lex_op; /* extra info to pass back on op */
SV *lex_repl; /* runtime replacement from s/// */
I32 lex_inwhat; /* what kind of quoting are we in */
I32 lex_starts; /* how many interps done on level */
SV *lex_stuff; /* runtime pattern from m// or s/// */
I32 multi_start; /* 1st line of multi-line string */
Expand Down
2 changes: 1 addition & 1 deletion perl.h
Expand Up @@ -5013,8 +5013,8 @@ struct am_table {
U32 flags;
U32 was_ok_sub;
long was_ok_am;
CV* table[NofAMmeth];
long fallback;
CV* table[NofAMmeth];
};
struct am_table_short {
U32 flags;
Expand Down

0 comments on commit 9bd8781

Please sign in to comment.