Optimse memory use for arbitrary-RR caching.

RRs 13 bytes or less don't need to allocate block storage.
This commit is contained in:
Simon Kelley
2023-03-31 17:44:02 +01:00
parent 153eeb070b
commit 138e1e2a2d
3 changed files with 86 additions and 58 deletions

View File

@@ -331,8 +331,16 @@ union all_addr {
} log;
/* for arbitrary RR record. */
struct {
struct blockdata *rrdata;
unsigned short rrtype, datalen;
#define RR_IMDATALEN 13 /* 16 - sizeof(short) - sizeof (char) */
unsigned short rrtype;
char len; /* -1 for blockdata */
union {
char data[RR_IMDATALEN];
struct {
unsigned short datalen;
struct blockdata *rrdata;
} block;
} u;
} rr;
};