[Xapian-tickets] [Xapian] #788: Thread safe move semantics

Xapian nobody at xapian.org
Sat Nov 2 10:03:04 GMT 2019


#788: Thread safe move semantics
-------------------------+-------------------------------
 Reporter:  Kronuz       |             Owner:  olly
     Type:  defect       |            Status:  new
 Priority:  high         |         Milestone:  1.5.0
Component:  Library API  |           Version:  git master
 Severity:  normal       |        Resolution:
 Keywords:               |        Blocked By:
 Blocking:               |  Operating System:  All
-------------------------+-------------------------------
Changes (by olly):

 * version:   => git master
 * component:  Other => Library API
 * milestone:   => 1.5.0


Comment:

 Was there a reason to set the internal to `0` in the two cases there,
 rather than just swap the internals?  If we swap, the temporary object
 would unref the swapped in internal, rather than that happening in the
 assignment.

 I'm not sure I see the benefits of `internal_intrusive_ptr` over just
 going back to using `intrusive_ptr` if we can no longer actually enforce
 the nonnull-ness.

 If we could actually keep the nonnull-ness aspect, then I guess the key
 question is whether the cost of having to allocate a dummy internal for
 this case (and having to call into the shared library to do it) outweighs
 the benefits of being able to rely on the internals not being NULL.

--
Ticket URL: <https://trac.xapian.org/ticket/788#comment:1>
Xapian <https://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list