From: Mark Geisert <mark@maxrnd.com>
To: cygwin-developers@cygwin.com
Subject: Coding style question for Corinna
Date: Thu, 12 Nov 2020 22:02:19 -0800 (PST) [thread overview]
Message-ID: <Pine.BSF.4.63.2011122152520.95690@m0.truegem.net> (raw)
Hi Corinna,
I'm about to submit the patches for a small improvement to Cygwin's malloc
implementation. There are several places in malloc_wrapper.cc where I
have minor code repetition inside an #if. But it could be coded
differently.. so which of the following forms do you prefer?
--- form 1 ---
if (!use_internal)
user_data->free (p);
else
{
#if MSPACES
void *m = get_current_mspace ();
if (likely(m))
mspace_free (m, p);
else
dlfree (p);
#else
dlfree (p);
#endif
}
--- form 2 ---
if (!use_internal)
user_data->free (p);
else
{
#if MSPACES
void *m = get_current_mspace ();
if (likely(m))
mspace_free (m, p);
else
#endif
dlfree (p);
}
Thanks,
..mark
next reply other threads:[~2020-11-13 6:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 6:02 Mark Geisert [this message]
2020-11-13 9:22 ` Corinna Vinschen
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=Pine.BSF.4.63.2011122152520.95690@m0.truegem.net \
--to=mark@maxrnd.com \
--cc=cygwin-developers@cygwin.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).