From 0a706b5b413aa96a944f45f28fb948c62e763555 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sat, 24 Jul 2021 14:44:07 +0000 Subject: Reduce size of the Term struct from about 72 bytes to 48 --- dat.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'dat.h') diff --git a/dat.h b/dat.h index d6adb18..b2ae80b 100644 --- a/dat.h +++ b/dat.h @@ -18,18 +18,25 @@ struct Operator Operator *next; }; -struct Term +struct Compound { - int tag; - Rune *text; int arity; - Term *next; Term *children; - vlong ival; - double dval; +}; + +struct Term +{ + u8int tag; + u8int inparens; uvlong clausenr; - int inparens; /* kinda bad hack needed for the current parser */ + Term *next; + + union { + vlong ival; + double dval; + struct Compound; + }; }; struct Binding -- cgit v1.2.3