Use bitfields to further reduce data structure size

This commit is contained in:
Eric Fischer
2016-05-13 15:45:33 -07:00
parent f0e90620e4
commit 331deca4b4
3 changed files with 10 additions and 3 deletions
+5 -2
View File
@@ -11,10 +11,13 @@
#define VT_NUMBER 2
#define VT_BOOLEAN 7
// The bitfield is to make sizeof(draw) be 16 instead of 24
// at the cost, apparently, of a 0.7% increase in running time
// for packing and unpacking.
struct draw {
long long x;
long long y;
long long x : 40;
signed char op;
long long y : 40;
signed char necessary;
draw(int nop, long long nx, long long ny) {