[pypy-commit] pypy cpyext-ext: * Remove unicode_alloc.
arigo
pypy.commits at gmail.com
Tue Mar 15 11:49:22 EDT 2016
Author: Armin Rigo <arigo at tunes.org>
Branch: cpyext-ext
Changeset: r83072:251f4973a108
Date: 2016-03-15 16:48 +0100
http://bitbucket.org/pypy/pypy/changeset/251f4973a108/
Log: * Remove unicode_alloc.
* Ensure the order of the fields is correct (might be unnecessary,
but feels safer).
diff --git a/pypy/module/cpyext/bytesobject.py b/pypy/module/cpyext/bytesobject.py
--- a/pypy/module/cpyext/bytesobject.py
+++ b/pypy/module/cpyext/bytesobject.py
@@ -53,8 +53,8 @@
PyStringObjectStruct = lltype.ForwardReference()
PyStringObject = lltype.Ptr(PyStringObjectStruct)
PyStringObjectFields = PyObjectFields + \
- (("ob_shash", rffi.LONG), ("ob_sstate", rffi.INT),
- ("buffer", rffi.CCHARP), ("ob_size", Py_ssize_t))
+ (("ob_size", Py_ssize_t), ("ob_shash", rffi.LONG),
+ ("ob_sstate", rffi.INT), ("buffer", rffi.CCHARP))
cpython_struct("PyStringObject", PyStringObjectFields, PyStringObjectStruct)
@bootstrap_function
diff --git a/pypy/module/cpyext/unicodeobject.py b/pypy/module/cpyext/unicodeobject.py
--- a/pypy/module/cpyext/unicodeobject.py
+++ b/pypy/module/cpyext/unicodeobject.py
@@ -30,7 +30,6 @@
def init_unicodeobject(space):
make_typedescr(space.w_unicode.layout.typedef,
basestruct=PyUnicodeObject.TO,
- alloc = unicode_alloc,
attach=unicode_attach,
dealloc=unicode_dealloc,
realize=unicode_realize)
@@ -48,6 +47,7 @@
'''
see comments with string_alloc in stringobject.py
'''
+ XXX
from pypy.module.cpyext.typeobjectdefs import PyTypeObjectPtr
pytype = as_pyobj(space, w_type)
pytype = rffi.cast(PyTypeObjectPtr, pytype)
More information about the pypy-commit
mailing list