Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-03-22 10:47:26


Mark Holloway wrote:
> I realise my requirements may be rather specific, but it seems
> shared_ptr has picked up some typeid baggage, which I can't afford.

Whyever not?

> I'm compiling using MSVC7.1 and for each object for which I use a
> shared_ptr, I gain an entry in my binary. For example, class Monty
> generates the following string in my exe:
> ?AU?$checked_deleter_at_VMonty@@@boost@@
>
> This seems to be sucked in by this function in class
> sp_counted_base_impl:
> virtual void * get_deleter(std::type_info const & ti)
> {
> return ti == typeid(D)? &del: 0;
> }
>
> It isn't being used, and I can't actually see anything in boost using
> this, so maybe the compiler isn't doing a great job at stripping unused
> stuff?
>
> Anyone shed some light on this for me?

Virtual functions generally can't be dropped by the linker because it
cannot tell whether or not they are used.

Ben.


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