This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/5] support: don't pass to resolv_test_start a big struct by value


* Konstantin Kharlamov:

> diff --git a/support/resolv_test.h b/support/resolv_test.h
> index c9e48205ab..880330ad5c 100644
> --- a/support/resolv_test.h
> +++ b/support/resolv_test.h
> @@ -116,7 +116,7 @@ void resolv_test_init (void);
>     needed.  As a side effect, NSS is reconfigured to use nss_dns only
>     for aplicable databases, and the process may enter a network
>     namespace for better isolation.  */
> -struct resolv_test *resolv_test_start (struct resolv_redirect_config);
> +struct resolv_test *resolv_test_start (const struct resolv_redirect_config*);

This patch would adjusting all the tests that call resolv_test_start,
and these changes are missing from the patch.  It is unclear how this
change would be an improvement because most tests call
resolv_test_start exactly once and the parameter object is never used
again.  Passing a pointer requires writing the argument object to the
stack *and* supplying its address to resolv_test_start, which requires
more work.  (Maybe some targets have more optimized code for struct
initialization than passing many zero arguments, but that's a GCC
issue which will eventually be fixed.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]