OSPF performance/SPF calculations
Ondrej Zajicek
santiago at crfreenet.org
Fri Apr 23 12:01:29 CEST 2010
On Fri, Apr 23, 2010 at 11:37:56AM +0200, Joakim Tjernlund wrote:
> > realloc() is used only for a persistent buffer to grow it sufficiently
> > large. So it is called only small number of times during the run of
> > the program and not in subsequent LSA originations. Therefore it is
> > not an issue.
>
> It would be better if you used the same (linear space) as you do
> for received LSA's. I guess the received LSA's has a MAX size?
> Then you could allocate space as big as the MAX received LSAs size,
> add data to it and, if you want to, realloc the the whole
> LSA to a smaller size.
Received LSAs are copied from RX buffer to the space allocated for
them. Originated LSAs are prepared in the persistent buffer and then
copied to the space allocated for them. In both cases the final
space for the LSA is allocated once (not reallocated) for the final
size of the LSA.
--
Elen sila lumenn' omentielvo
Ondrej 'SanTiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20100423/d9ca5e29/attachment-0001.asc>
More information about the Bird-users
mailing list