Hi,

Some comments:

- a few calls to avsv_dnd_msg_free() has an unnecessary cast in them
that should be removed:

$ grep msg_free */*.cc  | grep cast
amfd/ndmsg.cc:
avsv_dnd_msg_free(static_cast<AVSV_DND_MSG*>(dec_info->o_msg));
amfnd/mds.cc:
avsv_dnd_msg_free(static_cast<AVSV_DND_MSG*>(dec_info->o_msg));
amfnd/mds.cc:
avsv_nd2nd_avnd_msg_free(static_cast<AVSV_ND2ND_AVND_MSG*>(dec_info->o_msg));
amfnd/mds.cc:
avsv_nda_ava_msg_free(static_cast<AVSV_NDA_AVA_MSG*>(dec_info->o_msg));
amfnd/mds.cc:
avsv_dnd_msg_free(static_cast<AVSV_DND_MSG*>(dec_info->o_msg));
amfnd/mds.cc:
avsv_nd2nd_avnd_msg_free(static_cast<AVSV_ND2ND_AVND_MSG*>(dec_info->o_msg));

- in avd_reg_su_evh() there is a missing call to avsv_dnd_msg_free()
around line 114 (these _evh functions have a lot of redundant code and
should be reworked later)

- using valgrind I could spot quite a few imbalances, delete [] should
be used in many places. And amfnd has problems of sharing code with
libs/common for ava messages. Probably we should keep using
malloc/free so that the shared code could remain?

- in avnd_evt_destroy free is used, should be delete. Memory is
allocated in the same file in avnd_evt_create()


A new patch is needed.

Thanks,
Hans

On 24 October 2013 17:20, Hans Nordeback <[email protected]> wrote:
> Summary: amf:replace malloc/calloc with new and delete for amfd and amfnd 
> [#94]
> Review request for Trac Ticket(s): #94
> Peer Reviewer(s): hansf, nagendra, praveen
> Pull request to:
> Affected branch(es): default
> Development branch: default
>
> --------------------------------
> Impacted area       Impact y/n
> --------------------------------
>  Docs                    n
>  Build system            n
>  RPM/packaging           n
>  Configuration files     n
>  Startup scripts         n
>  SAF services            y
>  OpenSAF services        n
>  Core libraries          n
>  Samples                 n
>  Tests                   n
>  Other                   n
>
>
> Comments (indicate scope for each "y" above):
> ---------------------------------------------
>  <<EXPLAIN/COMMENT THE PATCH SERIES HERE>>
>
> changeset 6eff670395177863c9b7ba1a4f4b8b14d232c815
> Author: Hans Nordeback <[email protected]>
> Date:   Thu, 24 Oct 2013 17:13:43 +0200
>
>         amf: replace malloc/calloc with new and delete for amfd and amfnd 
> [#94]
>
>         Replace malloc/calloc with new and delete for amfd and amfnd. strdup,
>         realloc are temporary fixed, more work has to be done. Updated with 
> with
>         review comments.
>
>
> Complete diffstat:
> ------------------
>  osaf/services/saf/amf/amfd/app.cc               |    7 +-
>  osaf/services/saf/amf/amfd/apptype.cc           |   12 +-
>  osaf/services/saf/amf/amfd/chkop.cc             |   19 +-
>  osaf/services/saf/amf/amfd/comp.cc              |    7 +-
>  osaf/services/saf/amf/amfd/compcstype.cc        |   27 ++-
>  osaf/services/saf/amf/amfd/comptype.cc          |    7 +-
>  osaf/services/saf/amf/amfd/csi.cc               |   23 +-
>  osaf/services/saf/amf/amfd/csiattr.cc           |   33 +--
>  osaf/services/saf/amf/amfd/cstype.cc            |   25 ++-
>  osaf/services/saf/amf/amfd/ctcstype.cc          |    9 +-
>  osaf/services/saf/amf/amfd/dmsg.cc              |    8 +-
>  osaf/services/saf/amf/amfd/imm.cc               |  634 
> ++++++++++++++++++++++++++++++++++++--------------------------------------------
>  osaf/services/saf/amf/amfd/include/amfd.h       |    2 +-
>  osaf/services/saf/amf/amfd/include/imm.h        |   63 +++++++-
>  osaf/services/saf/amf/amfd/include/util.h       |    1 +
>  osaf/services/saf/amf/amfd/main.cc              |   32 +--
>  osaf/services/saf/amf/amfd/mds.cc               |   20 +-
>  osaf/services/saf/amf/amfd/ndfsm.cc             |   11 +-
>  osaf/services/saf/amf/amfd/ndmsg.cc             |   25 +--
>  osaf/services/saf/amf/amfd/node.cc              |   21 +-
>  osaf/services/saf/amf/amfd/nodegroup.cc         |    9 +-
>  osaf/services/saf/amf/amfd/pg.cc                |   12 +-
>  osaf/services/saf/amf/amfd/role.cc              |   13 +-
>  osaf/services/saf/amf/amfd/sg.cc                |    7 +-
>  osaf/services/saf/amf/amfd/sgproc.cc            |   17 +-
>  osaf/services/saf/amf/amfd/sgtype.cc            |   13 +-
>  osaf/services/saf/amf/amfd/si.cc                |   34 ++--
>  osaf/services/saf/amf/amfd/si_dep.cc            |   48 ++----
>  osaf/services/saf/amf/amfd/siass.cc             |    8 +-
>  osaf/services/saf/amf/amfd/sirankedsu.cc        |    7 +-
>  osaf/services/saf/amf/amfd/su.cc                |   13 +-
>  osaf/services/saf/amf/amfd/sutcomptype.cc       |    7 +-
>  osaf/services/saf/amf/amfd/sutype.cc            |   13 +-
>  osaf/services/saf/amf/amfd/svctype.cc           |   25 ++-
>  osaf/services/saf/amf/amfd/svctypecstypes.cc    |    7 +-
>  osaf/services/saf/amf/amfd/timer.cc             |    5 +-
>  osaf/services/saf/amf/amfd/util.cc              |  287 
> ++++++++++++++++++++---------------
>  osaf/services/saf/amf/amfnd/cbq.cc              |   17 +-
>  osaf/services/saf/amf/amfnd/chc.cc              |    5 +-
>  osaf/services/saf/amf/amfnd/ckpt_updt.cc        |   14 +-
>  osaf/services/saf/amf/amfnd/clc.cc              |   22 +-
>  osaf/services/saf/amf/amfnd/comp.cc             |   38 +---
>  osaf/services/saf/amf/amfnd/compdb.cc           |  134 ++++++++--------
>  osaf/services/saf/amf/amfnd/cpm.cc              |    7 +-
>  osaf/services/saf/amf/amfnd/di.cc               |  279 
> ++++++++++++++++-------------------
>  osaf/services/saf/amf/amfnd/evt.cc              |    9 +-
>  osaf/services/saf/amf/amfnd/hcdb.cc             |   20 +-
>  osaf/services/saf/amf/amfnd/include/avnd_util.h |    7 +
>  osaf/services/saf/amf/amfnd/mbcsv.cc            |    8 +-
>  osaf/services/saf/amf/amfnd/mds.cc              |   10 +-
>  osaf/services/saf/amf/amfnd/mon.cc              |   22 +-
>  osaf/services/saf/amf/amfnd/pg.cc               |   33 +---
>  osaf/services/saf/amf/amfnd/pgdb.cc             |   26 +--
>  osaf/services/saf/amf/amfnd/proxy.cc            |   91 ++++------
>  osaf/services/saf/amf/amfnd/proxydb.cc          |   37 +--
>  osaf/services/saf/amf/amfnd/sidb.cc             |   36 +---
>  osaf/services/saf/amf/amfnd/su.cc               |    3 +-
>  osaf/services/saf/amf/amfnd/sudb.cc             |   10 +-
>  osaf/services/saf/amf/amfnd/susm.cc             |    4 +-
>  osaf/services/saf/amf/amfnd/util.cc             |  310 
> +++++++++++++++++++++++++++++++++++++-
>  60 files changed, 1368 insertions(+), 1285 deletions(-)
>
>
> Testing Commands:
> -----------------
>  <<LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES>>
>
>
> Testing, Expected Results:
> --------------------------
>  <<PASTE COMMAND OUTPUTS / TEST RESULTS>>
>
>
> Conditions of Submission:
> -------------------------
>  <<HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC>>
>
>
> Arch      Built     Started    Linux distro
> -------------------------------------------
> mips        n          n
> mips64      n          n
> x86         n          n
> x86_64      y          y
> powerpc     n          n
> powerpc64   n          n
>
>
> Reviewer Checklist:
> -------------------
> [Submitters: make sure that your review doesn't trigger any checkmarks!]
>
>
> Your checkin has not passed review because (see checked entries):
>
> ___ Your RR template is generally incomplete; it has too many blank entries
>     that need proper data filled in.
>
> ___ You have failed to nominate the proper persons for review and push.
>
> ___ Your patches do not have proper short+long header
>
> ___ You have grammar/spelling in your header that is unacceptable.
>
> ___ You have exceeded a sensible line length in your headers/comments/text.
>
> ___ You have failed to put in a proper Trac Ticket # into your commits.
>
> ___ You have incorrectly put/left internal data in your comments/files
>     (i.e. internal bug tracking tool IDs, product names etc)
>
> ___ You have not given any evidence of testing beyond basic build tests.
>     Demonstrate some level of runtime or other sanity testing.
>
> ___ You have ^M present in some of your files. These have to be removed.
>
> ___ You have needlessly changed whitespace or added whitespace crimes
>     like trailing spaces, or spaces before tabs.
>
> ___ You have mixed real technical changes with whitespace and other
>     cosmetic code cleanup changes. These have to be separate commits.
>
> ___ You need to refactor your submission into logical chunks; there is
>     too much content into a single commit.
>
> ___ You have extraneous garbage in your review (merge commits etc)
>
> ___ You have giant attachments which should never have been sent;
>     Instead you should place your content in a public tree to be pulled.
>
> ___ You have too many commits attached to an e-mail; resend as threaded
>     commits, or place in a public tree for a pull.
>
> ___ You have resent this content multiple times without a clear indication
>     of what has changed between each re-send.
>
> ___ You have failed to adequately and individually address all of the
>     comments and change requests that were proposed in the initial review.
>
> ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)
>
> ___ Your computer have a badly configured date and time; confusing the
>     the threaded patch review.
>
> ___ Your changes affect IPC mechanism, and you don't present any results
>     for in-service upgradability test.
>
> ___ Your changes affect user manual and documentation, your patch series
>     do not contain the patch that updates the Doxygen manual.
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
> _______________________________________________
> Opensaf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to