This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: [smart containers] _M_clear()


Phil,

I was thinking about your original proposal to have release() get
called from within the clear() method.  With your particular pointer,
can the assignment "ptr = NULL;" have the same effect as calling
release() ?   I was thinking that such assignments could be added to
the container code after the call to deallocate(). Your pointer would
see that call, could confirm that ref counts on the set have dropped
to 0, and release() their current contents.  Obviously, that code
would work equally well for standard pointers as well as smart ones.

If that doesn't help with your particular case, then I agree we could
just use what you've done in your note as an alternative.  I remember
you had some minor concerns about having to write your allocator with
a deallocate() method that takes the pointer by reference, and thought
this might eliminate the need for that.

Thanks,
- Bob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]