From: Simon Wunderlich <sw@simonwunderlich.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Sven Eckelmann <sven@narfation.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH] alfred: Use memleak/error path free implementation of hash_resize
Date: Tue, 27 May 2014 16:17:39 +0200 [thread overview]
Message-ID: <201405271617.39346.sw@simonwunderlich.de> (raw)
In-Reply-To: <1400940034-13406-1-git-send-email-sven@narfation.org>
> The current implementation of hash_resize uses hash_add directly to
> initialize two a new hash table. But hash_add has two error cases: Data
> already exists and malloc fails.
>
> The check for the duplicated data is not really harmful (beside increasing
> the time to re-add elements) but the malloc can potentially return an
> error. This malloc is unnecessary and just takes extra time and is a
> potential candidate for errors. Instead the bucket from the old hash table
> can be re-used.
Applied in revision 6bbde09.
Thanks!
Simon
next prev parent reply other threads:[~2014-05-27 14:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-24 14:00 [B.A.T.M.A.N.] [PATCH] alfred: Use memleak/error path free implementation of hash_resize Sven Eckelmann
2014-05-27 14:17 ` Simon Wunderlich [this message]
2014-05-27 14:19 ` [B.A.T.M.A.N.] [PATCHv2] " Sven Eckelmann
2014-05-27 17:13 ` Simon Wunderlich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201405271617.39346.sw@simonwunderlich.de \
--to=sw@simonwunderlich.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=sven@narfation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox