[Python-checkins] r46002 - in python/branches/release24-maint: Misc/ACKS Misc/NEWS Objects/unicodeobject.c

M.-A. Lemburg mal at egenix.com
Mon May 15 10:35:56 CEST 2006


neal.norwitz wrote:
> Author: neal.norwitz
> Date: Mon May 15 09:22:23 2006
> New Revision: 46002
>> Modified:
> python/branches/release24-maint/Misc/ACKS
> python/branches/release24-maint/Misc/NEWS
> python/branches/release24-maint/Objects/unicodeobject.c
> Log:
> Backport: Patch #1488312, Fix memory alignment problem on SPARC in unicode.
>> Modified: python/branches/release24-maint/Misc/NEWS
> ==============================================================================
> --- python/branches/release24-maint/Misc/NEWS	(original)
> +++ python/branches/release24-maint/Misc/NEWS	Mon May 15 09:22:23 2006
> @@ -12,6 +12,8 @@
> Core and builtins
> -----------------
>> +- Patch #1488312, Fix memory alignment problem on SPARC in unicode
> +
> Extension Modules
> -----------------
>>> Modified: python/branches/release24-maint/Objects/unicodeobject.c
> ==============================================================================
> --- python/branches/release24-maint/Objects/unicodeobject.c	(original)
> +++ python/branches/release24-maint/Objects/unicodeobject.c	Mon May 15 09:22:23 2006
> @@ -2302,7 +2302,7 @@
> end = s + size;
>> while (s < end) {
> - *p = *(Py_UNICODE *)s;
> + memcpy(p, s, sizeof(Py_UNICODE));
> /* We have to sanity check the raw data, otherwise doom looms for
> some malformed UCS-4 data. */
> if (

Could you please make this fix apply only on Solaris,
e.g. using an #ifdef ?!
The memcpy is a lot more expensive than a simple memory
copy via registers and this operation is done per code point
in the Unicode string, so any change to the inner loop makes
a difference.
Thanks,
-- 
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, May 15 2006)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /