[bind10-dev] use of boost offset_ptr for in-memory data structure

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Mon Jun 11 17:41:44 UTC 2012


At Mon, 11 Jun 2012 16:14:30 +0200,
Michal 'vorner' Vaner <michal.vaner at nic.cz> wrote:

> This looks nice. I think it is better to use the offset pointer unconditionally
> to see it works even in cases where we don't really need them.
> 
> Also, is there something like shared offset pointer? I don't know if it might be
> useful or not, though.

Like boost::shared_ptr?  I don't know, probably there isn't within
boost.  I hope we won't need it, however, because for our specific
purposes memory management will take place in a restricted entity
(some specific part of the in-memory datasource implementation in the
initial version, and something like "b10-memorymgr" in the shared
memory version) and all others parts of the code will access the data
read-only and can assume it's valid as long as the writer entity is
alive.

> However, I think there still be some difficulties. We may want to have multiple
> segments allocated and point from one to another, for example.

Hmm, if it's required that will be tricky.  It will depend on more
details of the actual design, so I cannot be sure at this moment.  In
the design we should take it into account and try to avoid creating
such dependencies if we can have choices. 

---
JINMEI, Tatuya
Internet Systems Consortium, Inc.


More information about the bind10-dev mailing list