summaryrefslogtreecommitdiff
path: root/babeld/util.c
diff options
context:
space:
mode:
authorJorge Boncompte [DTI2] <jorge@dti2.net>2012-05-07 16:52:51 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2012-05-22 20:25:02 +0200
commitf669f7d25f0f491d5e487897227ff434aef20406 (patch)
tree4b040b835be1d47b7eca7240b7d7aa4b9e6f177b /babeld/util.c
parent8692c506520f6b268525b80890702432c95f13c4 (diff)
bgpd: optimize aspath string representation and assegments handling
* bgp_aspath.h: Add str_len to struct aspath. * bgp_aspath.c: Save the aspath string representation length and use it instead of strlen(). (aspath_make_str_count) assign the string buffer directly for consistency with the string length and change the return type to void. (aspath_dup) use str_len and copy the string instead of calling aspath_make_str_count(). (assegment_data_new) change from XCALLOC to XMALLOC. All users initialize the memory before use. (assegment_data_free) unused, removed. (aspath_intern) check that there's always a ->str pointer. (aspath_hash_alloc) reuse assegments and string representation instead of copying them. (aspath_parse) now aspath_hash_alloc does not dupes memory, free the temporary structures only if the aspath it is in the hash. (aspath_cmp_left) remove useless NULL initialization. Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'babeld/util.c')
0 files changed, 0 insertions, 0 deletions