Coding style question for Corinna
Mark Geisert
mark@maxrnd.com
Fri Nov 13 06:02:19 GMT 2020
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
More information about the Cygwin-developers
mailing list