Commit e00c9f0d authored by Shenghou Ma's avatar Shenghou Ma

cmd/5l: move offset2 into Adr.u0 union to save 4/8 bytes for Adr/Prog resp.

sizeof(Adr) from 24 bytes down to 20 bytes.
sizeof(Prog) from 84 bytes down to 76 bytes.

5l linking cmd/godoc statistics:
Before:
Maximum resident set size (kbytes): 106668
After:
Maximum resident set size (kbytes):  99412

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7100059
parent bee148bf
......@@ -68,21 +68,24 @@ struct Adr
{
union
{
int32 u0offset;
struct {
int32 offset;
int32 offset2; // argsize
} u0off;
char* u0sval;
Ieee u0ieee;
char* u0sbig;
} u0;
Sym* sym;
Sym* gotype;
int32 offset2; // argsize
char type;
char reg;
char name;
char class;
};
#define offset u0.u0offset
#define offset u0.u0off.offset
#define offset2 u0.u0off.offset2
#define sval u0.u0sval
#define scon sval
#define ieee u0.u0ieee
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment