summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-rr.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-15 21:38:27 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-17 20:47:46 +0100
commitf57e3cd5fa709ec0f52531eccba909ac0851927c (patch)
treeb68b42dbf9af7dd7c82c75859c3ac06f17fdeda4 /src/resolve/resolved-dns-rr.h
parent2e1bab34bdb1a5e849060afa8361b865ce39f87f (diff)
resolved: try to reduce number or DnsResourceKeys we keep around by merging them
Quite often we read the same RR key multiple times from the same message. Try to replace them by a single object when we notice this. Do so again when we add things to the cache. This should reduce memory consumption a tiny bit.
Diffstat (limited to 'src/resolve/resolved-dns-rr.h')
-rw-r--r--src/resolve/resolved-dns-rr.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-rr.h b/src/resolve/resolved-dns-rr.h
index 8ab53211a9..d9c31e81c5 100644
--- a/src/resolve/resolved-dns-rr.h
+++ b/src/resolve/resolved-dns-rr.h
@@ -81,7 +81,7 @@ enum {
};
struct DnsResourceKey {
- unsigned n_ref;
+ unsigned n_ref; /* (unsigned -1) for const keys, see below */
uint16_t class, type;
char *_name; /* don't access directy, use DNS_RESOURCE_KEY_NAME()! */
};
@@ -294,6 +294,8 @@ static inline bool dns_key_is_shared(const DnsResourceKey *key) {
return IN_SET(key->type, DNS_TYPE_PTR);
}
+bool dns_resource_key_reduce(DnsResourceKey **a, DnsResourceKey **b);
+
DnsResourceRecord* dns_resource_record_new(DnsResourceKey *key);
DnsResourceRecord* dns_resource_record_new_full(uint16_t class, uint16_t type, const char *name);
DnsResourceRecord* dns_resource_record_ref(DnsResourceRecord *rr);