Boost logo

Boost Users :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2008-06-11 11:31:36


Lothar Werzinger wrote:
> Hi, I try to use intrusive avl_set to put the set into a memory mapped file (I
> manage the file myself using just mapped_region.
>
> If I declare my node without offset_ptr my test program works as expected
> except that the pointers in the file are absolute. If I use offset_ptr I get
> a runtime assertion (see below). What I don't understand is why the assertion
> complains about uniqueness. Any help is appreciated!

Unless there is a bug (something that is of course, possible) if the
assertion reaises in this function of avltree.hpp:

iterator insert_unique_commit
  (reference value, const insert_commit_data &commit_data)
{
    node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
    if(safemode_or_autounlink)
       BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT
         (node_algorithms::unique(to_insert));
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

means that you've using a safe hook (the default one) and before
inserting an object, the container checks that the hook is in default
position (unique() is true). If it's not that means that the hook is
still use (the value is still inserted in another container). The
testsuite includes avl containers with offset_ptr<> pointers but this
might indicate a bug in Intrusive. Please check if that object is still
in another container and if not, it would be nice if you could provide a
test case that raises the bug.

Regards,

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net