unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar via Libc-alpha <libc-alpha@sourceware.org>
To: Florian Weimer <fweimer@redhat.com>,
	Siddhesh Poyarekar via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH] tests: use xmalloc to allocate implementation array
Date: Wed, 28 Jul 2021 13:01:59 +0530	[thread overview]
Message-ID: <defbe424-1d35-2587-0813-b35488b7f7c0@sourceware.org> (raw)
In-Reply-To: <87im0uaoig.fsf@oldenburg.str.redhat.com>

On 7/28/21 12:55 PM, Florian Weimer wrote:
> * Siddhesh Poyarekar via Libc-alpha:
> 
>> diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h
>> index fd25264417..03de372cff 100644
>> --- a/benchtests/bench-string.h
>> +++ b/benchtests/bench-string.h
>> @@ -18,6 +18,7 @@
>>   
>>   #include <getopt.h>
>>   #include <sys/cdefs.h>
>> +#include <support/support.h>
>>   
>>   /* We are compiled under _ISOMAC, so libc-symbols.h does not do this
>>      for us.  */
>> @@ -200,8 +201,8 @@ static impl_t *impl_array;
>>   		 skip = impl;						      \
>>   	       else							      \
>>   		 impl_count++;						      \
>> -	     a = impl_array = malloc ((impl_count + func_count) *	      \
>> -				   sizeof (impl_t));			      \
>> +	     a = impl_array = xmalloc ((impl_count + func_count) *	      \
>> +				       sizeof (impl_t));		      \
>>   	     for (impl = __start_impls; impl < __stop_impls; ++impl)	      \
>>   	       if (impl != skip)					      \
>>   		 *a++ = *impl;						      \
> 
> I'm surprised the benchtests link against libsupport.  There's some
> non-trivial setup code involved in libsupport for failure handling, and
> that gets linked into xmalloc.  It might affect the benchmarks.

Yeah, it may not hurt to wean them away; it's really just the string 
benchmarks that were copied over from tests and adapted.  I'll use 
programs/xmalloc.h here then.

Siddhesh

      reply	other threads:[~2021-07-28  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28  5:28 [PATCH] tests: use xmalloc to allocate implementation array Siddhesh Poyarekar via Libc-alpha
2021-07-28  7:25 ` Florian Weimer via Libc-alpha
2021-07-28  7:31   ` Siddhesh Poyarekar via Libc-alpha [this message]

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=defbe424-1d35-2587-0813-b35488b7f7c0@sourceware.org \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=siddhesh@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).