BIND 10 #2096: Define and implement "RdataReader" class

BIND 10 Development do-not-reply at isc.org
Fri Aug 24 10:29:00 UTC 2012


#2096: Define and implement "RdataReader" class
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jinmei
  jinmei                             |                Status:  reviewing
                       Type:  task   |             Milestone:
                   Priority:         |  Sprint-20120904
  medium                             |            Resolution:
                  Component:  data   |             Sensitive:  0
  source                             |           Sub-Project:  DNS
                   Keywords:         |  Estimated Difficulty:  5
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
  scalable inmemory                  |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by vorner):

 * owner:  vorner => jinmei


Comment:

 Hello

 Replying to [comment:19 jinmei]:
 > - it may be better to call nextInternal() directly from iterate()
 >   and iterateRdata() to skip the call redundancy.  it may be marginal
 >   or the compiler may optimize it anyway, but quick benchmark shows
 >   it's actually slightly faster.  or we may define next() inside
 >   the class definition to enforce inlining.
 > - in iterateSingleSig(), NO_BOUNDARY should be an impossible case.
 >   should we assert() it?

 Done, both.

 > - Not sure if you checked that, so: Is the revised version of
 >   getSize() okay?

 I did have a look and the code seemed sane, so I didn't comment.

 > Anyway, considering these, my latest personal suggestion would be:
 >
 > - create a file rdata_serialization.h/cc

 I think I did something like this. There's still one small but not really
 nice trick to share some of the private data structures with tests, but
 nobody should include it by mistake.

 > "The static_cast operator converts between related types such as one
 > pointer type to another in the same class hierarchy... The
 > reinterpret_cast handles conversion between unrelated types such
 > as... or a pointer to an unrelated pointer type".

 OK, let's leave it be. What I meant is, the reinterpret cast allows you to
 make a pointer from integer or data pointer from function pointer, which
 both can be OK on some architectures, but may be completely wrong on
 others (different sizes, non Van-Neuman architecture).

 Thank you

-- 
Ticket URL: <https://bind10.isc.org/ticket/2096#comment:21>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list