Opened 14 years ago

Closed 9 years ago

#2398 closed Feature Requests (wontfix)

Supply type info to debug hooks

Reported by: Jim Barry <jim@…> Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Severity: Not Applicable
Keywords: Cc:

Description

I have found it very useful to have access to the type names of shared objects for debugging purposes. May I suggest adding a type_info parameter to the hook functions:

void sp_scalar_constructor_hook( void * px, std::size_t size, 
    std::type_info const & ti, void * pn );

void sp_scalar_destructor_hook( void * px, std::size_t size, 
    std::type_info const & ti, void * pn );

Then sp_counted_impl_p can call them like this:

explicit sp_counted_impl_p( X * px ): px_( px )
{
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
    boost::sp_scalar_constructor_hook( px, sizeof(X), typeid(X), this );
#endif
}

virtual void dispose() // nothrow
{
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
    boost::sp_scalar_destructor_hook( px_, sizeof(X), typeid(X), this );
#endif
    boost::checked_delete( px_ );
}

Thanks!

Change History (3)

comment:1 by Peter Dimov, 14 years ago

Milestone: To Be Determined
Status: newassigned

comment:2 by Peter Dimov, 12 years ago

Status: assignednew

comment:3 by Peter Dimov, 9 years ago

Resolution: wontfix
Status: newclosed

Closing as "wontfix" because the ticket is too old. Please reopen if still relevant.

Note: See TracTickets for help on using tickets.