libmultipath: fix memory API logic error
Quoted 10 lines · tang.junhui
Memroy API use
mem_allocatedto record the total size of used memory, however, it's wrong to use size(p) as the length of freed memory inxfree(), and memory may also be allocated bySTRDUP()orREALLOC(), which is not calculated intomem_allocated, so the total size of used memory is not correctly. For these reasons, we removed these incorrectly code to keep the code clean.libmpathpersist/mpath_updatepr.c | 1 - libmultipath/memory.c | 31 ------------------------------- libmultipath/memory.h | 13 ++-----------
libmultipath/memory.[ch] files along with libmultipath/parser.[ch] and libmultipath/vector.[ch] come from keepalived/lib/ [1] .
Maybe it's worth to backport their fixes and new features.
Quoted 4 lines · Xose Vazquez Perez
libmultipath/memory.[ch] files along with libmultipath/parser.[ch] and libmultipath/vector.[ch] come from keepalived/lib/ [1] .
Maybe it's worth to backport their fixes and new features.
Hello Xose,
Are you aware that there are tools available that are much more powerful than keepalived's memory.[ch]? See e.g.
http://valgrind.org/info/tools.html#massif.
Bart.