static void scan_and_free(void * area, size_t size, map2_type const & m2, free_list_type & free)
{
    unsigned char * p = static_cast<unsigned char *>(area);

    for(size_t n = 0; n + sizeof(shared_ptr_layout) <= size; p += pointer_align, n += pointer_align)
    {
        shared_ptr_layout * q = reinterpret_cast<shared_ptr_layout *>(p);

        if(q->pn.id == abt_boost::detail::shared_count_id && q->pn.pi != 0 && m2.count(q->pn.pi) != 0 && q->px != 0)
        {
            abt_boost::shared_ptr<X> * ppx = reinterpret_cast< abt_boost::shared_ptr<X> * >(p);
            free.push_back(*ppx);
            ppx->reset();
        }
    }
}
Example #2
0
void scan_and_free(void * area, std::size_t size,
                   reachable_object_type const & m2, free_list_type & free)
{
    unsigned char * p = static_cast<unsigned char *>(area);

    for(std::size_t n = 0; n + sizeof(shared_ptr_layout) <= size;
        p += pointer_align, n += pointer_align)
    {
        shared_ptr_layout * q = reinterpret_cast<shared_ptr_layout *>(p);

        if(q->pn.id == phxpr::detail::shared_count_id && q->pn.pi != 0 &&
           m2.count(q->pn.pi) != 0 && q->px != 0)
        {
            phxpr::shared_ptr<sweep_tag> * ppx
                = reinterpret_cast< phxpr::shared_ptr<sweep_tag> * >(p);
            free.push_back(*ppx);
            ppx->reset();
        }
    }
}