[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1054249 - in /subversion/trunk/subversion: include/svn_types.h libsvn_delta/text_delta.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 27 Jan 2011 03:59:49 +0200

Is anyone testing the "SVN_UNALIGNED_ACCESS_IS_OK=0" code regularly?
On a quick inspection, all the bots describe themselves as x64, not ia64.

/me would add -DSVN_UNALIGNED_ACCESS_IS_OK=0 to his CFLAGS, but he isn't
building too often these days.

stefan2_at_apache.org wrote on Sat, Jan 01, 2011 at 16:14:05 -0000:
> Author: stefan2
> Date: Sat Jan 1 16:14:05 2011
> New Revision: 1054249
>
> URL: http://svn.apache.org/viewvc?rev=1054249&view=rev
> Log:
> Move the decision whether unaligned memory access is o.k.
> to a central place - svn_types.h. We will need that frequently
> in e.g. delta-related string processing.
>
> * subversion/include/svn_types.h
> (SVN_UNALIGNED_ACCESS_IS_OK): new macro
> * subversion/libsvn_delta/text_delta.c
> (patterning_copy): use the new macro instead of a local test
>
> Modified:
> subversion/trunk/subversion/include/svn_types.h
> subversion/trunk/subversion/libsvn_delta/text_delta.c
>
> Modified: subversion/trunk/subversion/include/svn_types.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_types.h?rev=1054249&r1=1054248&r2=1054249&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/include/svn_types.h (original)
> +++ subversion/trunk/subversion/include/svn_types.h Sat Jan 1 16:14:05 2011
> @@ -62,6 +62,24 @@ extern "C" {
> # endif
> #endif
>
> +
> +/** Indicate whether the current platform supports unaligned data access.
> + *
> + * On the majority of machines running SVN (x86 / x64), unaligned access
> + * is much cheaper than repeated aligned access. Define this macro to 1
> + * on those machines.
> + * Unaligned access on other machines (e.g. IA64) will trigger memory
> + * acccess faults or simply misbehave.
> + *
> + * @since New in 1.7.
> + */
> +#ifndef SVN_UNALIGNED_ACCESS_IS_OK
> +# if defined(_M_IX86) || defined(_M_X64) || defined(i386) || defined(__x86_64)
> +# define SVN_UNALIGNED_ACCESS_IS_OK 1
> +# else
> +# define SVN_UNALIGNED_ACCESS_IS_OK 0
> +# endif
> +#endif
>
>
> /** Subversion error object.
>
> Modified: subversion/trunk/subversion/libsvn_delta/text_delta.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/text_delta.c?rev=1054249&r1=1054248&r2=1054249&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_delta/text_delta.c (original)
> +++ subversion/trunk/subversion/libsvn_delta/text_delta.c Sat Jan 1 16:14:05 2011
> @@ -606,11 +606,9 @@ patterning_copy(char *target, const char
> {
> const char *end = source + len;
>
> - /* On the majority of machines (x86 / x64), unaligned access is much
> - * cheaper than repeated aligned access. Therefore, use chunky copies on
> - * these machines when feasible.
> - * For those machines, GCC, ICC and MSC will define one of the following: */
> -#if defined(_M_IX86) || defined(_M_X64) || defined(i386) || defined(__x86_64)
> + /* On many machines, we can do "chunky" copies. */
> +
> +#if SVN_UNALIGNED_ACCESS_IS_OK
>
> if (end + sizeof(apr_uint32_t) <= target)
> {
>
>
Received on 2011-01-27 03:04:23 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.