Boost logo

Boost :

From: Chris Thomasson (cristom_at_[hidden])
Date: 2006-10-22 23:19:13


DOH!!!

I found a killed a bug. It only existed in the C++ Abstraction API. It has
to do with the fact that pointers to user objects are contained in the
userstate<T>::m_state member. I was returning a pointer to the userstate<T>,
rather than the userstate<T>::m_state member in the following functions:

inline T* load_ptr() throw() {
  return static_cast<T*>(atomic_state_load_depends());
}

inline T const* load_ptr() const throw() {
  return static_cast<T const*>(atomic_state_load_depends());
}

They have to be changed to this:

inline T* load_ptr() throw() {
  return static_cast<userstate<T>*>(atomic_state_load_depends())->m_state;
}

inline T const* load_ptr() const throw() {
  return static_cast<userstate<T>*>(atomic_state_load_depends())->m_state;
}

Also, you need to add this to the userstate<T> class:

friend class ptr_base<T>;

The code is fixed on my site. Sorry for any confusion!

;^(...

Luckily, the bug was in the C++ layer, and not in the assembly!

;^)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk