|
Boost Users : |
Subject: Re: [Boost-users] [serialization] dynamically allocated objects and reset_object_address
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2008-11-19 16:40:54
Robert Ramey <ramey <at> rrsd.com> writes:
>
> joaquin <at> tid.es wrote:
> > Having a look at the source code of Boost.Serialization
> > (basic_iarchive.cpp) it's
> > apparent that moveable_objects_recent and moveable_objects_end are
> > updated inside basic_iarchive::load_object, but are not inside
> > basic_iarchive::load_pointer.
> > Of course, I don't know what the hidden implications of updating these
> > also in
> > load_pointer could be, but I'd appreciate if you could comment on
> > this.
>
> OK, I looked into this.
>
> The list of tracked object that might be relocated as soon is the
> library is "done" with them.
>
> line # 392 moveable_objects_recent = this_id;
>
> That is when the stack is shortened.
> This keeps the list prety short. I would have to think about this some
> more.
Thank you! I'll also have a look myself and hopefully
help a little.
> I presume that in your case something like the following wouldn't help?
>
> v.push_back(T());
> ar >> v.back(); // assuming v.back() returns a reference
Unfortunately, no :-/ It is mandatory that I load Ts always
through pointers.
JoaquÃn M López Muñoz
Telefónica, Investigación y Desarrollo
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