|
Boost : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2004-12-02 00:36:49
"JOAQUIN LOPEZ MU?Z" <joaquin_at_[hidden]> wrote in message
news:2096fa209c83.209c832096fa_at_tid.es...
> If in the meantime you do the check yourself please tell me what you come
up with.
Attached please find an updated version of test_list_ptrs.cpp which
illustrates my point. A couple of notes:
a) elminate the BOOST_SERIALIZATION_IMPLEMENT - its part of the next
version.
b) free_a_ptr is setup to be a copy of the first element of the list of
pointers.
c) this verifies that memory tracking takes care of everything necessary.
Note that this example doesn't address this issue of what happens if the
collection consisted of primitives (or string) which are not tracked by
default. That question is separate from the current issue.
Robert Ramey
begin 666 test_list_ptrs.cpp
M+R\O+R\O+R\O,2\O+R\O+R\O+S(O+R\O+R\O+R\S+R\O+R\O+R\O-"\O+R\O
M+R\O+S4O+R\O+R\O+R\V+R\O+R\O+R\O-R\O+R\O+R\O+S_at_-"B\O('1E<W1?
M;&ES="YC<' -"@T*+R\@*$,I($-O<'ER:6=H=" R,# R(%)O8F5R="!286UE
M>2 M(&AT=' Z+R]W=W<N<G)S9"YC;VT@+B -"B\O(%5S92P@;6]D:69I8V%T
M:6]N(&%N9"!D:7-T<FEB=71I;VX@:7,@<W5B:F5C="!T;R!T:&4_at_0F]O<W0@
M4V]F='=A<F4-"B\O($QI8V5N<V4L(%9E<G-I;VX@,2XP+B H4V5E(&%C8V]M
M<&%N>6EN9R!F:6QE($Q)0T5.4T5?,5\P+G1X="!O<B!C;W!Y(&%T#0HO+R!H
M='1P.B\O=W=W+F)O;W-T+F]R9R],24-%3E-%7S%?,"YT>'0I#0H-"B\O('-H
M;W5L9"!P87-S(&-O;7!I;&%T:6]N(&%N9"!E>&5C=71I;VX-"@T*(VEN8VQU
M9&4@/&9S=')E86T^#0H-"B-I;F-L=61E(#QC<W1D:6\^("\O(')E;6]V90T*
M(VEN8VQU9&4@/&)O;W-T+V-O;F9I9RYH<' ^#0HC:68_at_9&5F:6YE9"A"3T]3
M5%].3U]35$1#7TY!34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@
M(" @:68H='EP96ED*"I?3&5F="D@(3T@='EP96ED*"I?4FEG:'0I*0T*(" @
M(" @(" @(" @<F5T=7)N(&9A;'-E.PT*(" @(" @("!R971U<FX@*E],969T
M(#T]("I?4FEG:'0[#0H@(" @?0T*?3L-"@T*:6YT('1E<W1?;6%I;B@@:6YT
M("\J(&%R9V,@*B\L(&-H87(J("\J(&%R9W8@*B];72 I#0I[#0H@(" @8V]N
M<W0_at_8VAA<B J('1E<W1F:6QE(#T_at_8F]O<W0Z.F%R8VAI=F4Z.G1M<&YA;2A.
M54Q,*3L-"B @("!"3T]35%]215%525)%*$Y53$P@(3T@=&5S=&9I;&4I.PT*
M#0H@(" @<W1D.CIL:7-T/$$@*CX_at_86QI<W0[#0H@(" @02 J(&9R965?85]P
M='([#0H@(" @>R @( T*(" @(" @("!T97-T7V]S=')E86T@;W,H=&5S=&9I
M;&4L(%1%4U1?4U1214%-7T9,04=3*3L-"B @(" @(" @=&5S=%]O87)C:&EV
M92!O82AO<RD[#0H@(" @(" @(&9R965?85]P='(@/2!N97<@03L-"B @(" @
M(" @86QI<W0N<'5S:%]B86-K*&9R965?85]P='(I.PT*(" @(" @("!A;&ES
M="YP=7-H7V)A8VLH;F5W($$I.PT*(" @(" @(" O+R!V97)I9GD@=&AA="!F
M:7)S="!E;&5M96YT(&ES('1H92!S86UE(&%S('1H92!F<F5E('!O:6YT97(-
M"B @(" @(" @0D]/4U1?0TA%0TLH*"IA;&ES="YB96=I;B_at_I*2 ]/2!F<F5E
M7V%?<'1R*3L-"B @(" @(" @;V$@/#P_at_8F]O<W0Z.G-E<FEA;&EZ871I;VXZ
M.FUA:V5?;G9P*")A;&ES="(L(&%L:7-T*3L-"B @(" @(" @;V$@/#P_at_8F]O
M<W0Z.G-E<FEA;&EZ871I;VXZ.FUA:V5?;G9P*")F<F5E7V%?<'1R(BP_at_9G)E
M95]A7W!T<BD[#0H@(" @?0T*(" @('-T9#HZ;&ES=#Q!("H^(&%L:7-T,3L-
M"B @("!!("H_at_9G)E95]A7W!T<C$[#0H@(" @>PT*(" @(" @("!T97-T7VES
M=')E86T@:7,H=&5S=&9I;&4L(%1%4U1?4U1214%-7T9,04=3*3L-"B @(" @
M(" @=&5S=%]I87)C:&EV92!I82AI<RD[#0H@(" @(" @(&EA(#X^(&)O;W-T
M.CIS97)I86QI>F%T:6]N.CIM86ME7VYV<"@B86QI<W0B+"!A;&ES=#$I.PT*
M(" @(" @("!I82 ^/B!B;V]S=#HZ<V5R:6%L:7IA=&EO;CHZ;6%K95]N=G H
M(F9R965?85]P='(B+"!F<F5E7V%?<'1R,2D[#0H@(" @?0T*(" @($)/3U-4
M7T-(14-+* T*(" @(" @("!A;&ES="YS:7IE*"D@/3T_at_86QI<W0Q+G-I>F4H
M*2 -"B @(" @(" @)B8@<W1D.CIE<75A;"AA;&ES="YB96=I;B_at_I+&%L:7-T
M+F5N9"@I+&%L:7-T,2YB96=I;B_at_I+'!T<E]E<75A;%]T;SQ!("H^*"DI#0H@
M(" @*3L-"B @(" O+R!V97)I9GD@=&AA="!F:7)S="!E;&5M96YT(&ES('1H
M92!S86UE(&%S('1H92!F<F5E('!O:6YT97(-"B @("!"3T]35%]#2$5#2R_at_H
M*F%L:7-T,2YB96=I;B_at_I*2 ]/2!F<F5E7V%?<'1R,2D[#0H-"B @("!S=&0Z
M.F9O<E]E86-H* T*(" @(" @("!A;&ES="YB96=I;B_at_I+" -"B @(" @(" @
M86QI<W0N96YD*"DL( T*(" @(" @("!B;V]S=#HZ8VAE8VME9%]D96QE=&5R
M/$$^*"D-"B @(" I.PT*(" @('-T9#HZ9F]R7V5A8V_at_H#0H@(" @(" @(&%L
M:7-T,2YB96=I;B_at_I+" -"B @(" @(" @86QI<W0Q+F5N9"@I+" -"B @(" @
M(" @8F]O<W0Z.F-H96-K961?9&5L971E<CQ!/B_at_I#0H@(" @*3L-"B @(" -
M"B @(" C:69D968_at_0D]/4U1?2$%37U-,25-4#0H@(" @<W1D.CIL:7-T/$$@
M*CX_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N*"DL( T*(" @(" @
M("!A<VQI<W0Q+F5N9"@I+" -"B @(" @(" @8F]O<W0Z.F-H96-K961?9&5L
M971E<CQ!/B_at_I#0H@(" @*3L@( T*(" @("-E;F1I9_at_T*(" @('-T9#HZ<F5M
M;W9E*'1E<W1F:6QE*3L-"B @("!R971U<FX_at_8F]O<W0Z.F5X:71?<W5C8V5S
1<SL-"GT-"@T*+R\@14]�H`
`
end
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk