]> granicus.if.org Git - pdns/commitdiff
now this is a fun commit. Turns out each DNSRecordContent was dragging along a (wrong...
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 4 Nov 2015 09:27:21 +0000 (10:27 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Wed, 4 Nov 2015 09:27:21 +0000 (10:27 +0100)
sizeof has been reduced by 24 bytes now. Does not actually save a lot of memory because of malloc overhead. Does appear to save CPU.

pdns/dnsparser.cc
pdns/dnsparser.hh

index 9ef4cc1c30b8c10b18e27ca776b58c3931d8b1a2..bb4b532a33be2306fd35645cbb9201038cd488d5 100644 (file)
@@ -134,9 +134,6 @@ shared_ptr<DNSRecordContent> DNSRecordContent::unserialize(const DNSName& qname,
 
   MOADNSParser mdp((char*)&*packet.begin(), (unsigned int)packet.size());
   shared_ptr<DNSRecordContent> ret= mdp.d_answers.begin()->first.d_content;
-  ret->header.d_type=ret->d_qtype;
-  ret->label=mdp.d_answers.begin()->first.d_name;
-  ret->header.d_ttl=mdp.d_answers.begin()->first.d_ttl;
   return ret;
 }
 
index 4ee358012a16d211ba39fcf18f66e2697ec4118f..0834c3b7a102aa5fc8a1710fd9769b19ee3fd5f9 100644 (file)
@@ -192,9 +192,6 @@ public:
 
   void doRecordCheck(const struct DNSRecord&){}
 
-  DNSName label; // FIXME400 rename
-  struct dnsrecordheader header;
-
   typedef DNSRecordContent* makerfunc_t(const struct DNSRecord& dr, PacketReader& pr);  
   typedef DNSRecordContent* zmakerfunc_t(const string& str);  
 
@@ -239,15 +236,12 @@ public:
 
   explicit DNSRecordContent(uint16_t type) : d_qtype(type)
   {
-     memset(&header,0,sizeof(header));
   }
   
   
   DNSRecordContent& operator=(const DNSRecordContent& orig) 
   {
     const_cast<uint16_t&>(d_qtype) = orig.d_qtype; // **COUGH**
-    label = orig.label;
-    header = orig.header;
     return *this;
   }