Author: Spenser Bauman <[email protected]>
Branch: 
Changeset: r89677:6a4e761daeb3
Date: 2017-01-19 20:38 -0500
http://bitbucket.org/pypy/pypy/changeset/6a4e761daeb3/

Log:    Merge with default

diff --git a/lib_pypy/_collections.py b/lib_pypy/_collections.py
--- a/lib_pypy/_collections.py
+++ b/lib_pypy/_collections.py
@@ -1,13 +1,18 @@
 """High performance data structures
+
+Note that PyPy also contains a built-in module '_collections' which will hide
+this one if compiled in.
+
+THIS ONE IS BOGUS in the sense that it is NOT THREAD-SAFE!  It is provided
+only as documentation nowadays.  Please don't run in production a PyPy
+without the '_collections' built-in module.  The built-in module is
+correctly thread-safe, like it is on CPython.
 """
 #
 # Copied and completed from the sandbox of CPython
 #   (nondist/sandbox/collections/pydeque.py rev 1.1, Raymond Hettinger)
 #
 
-# Note that PyPy also contains a built-in module '_collections' which will hide
-# this one if compiled in.
-
 try:
     from threading import _get_ident as _thread_ident
 except ImportError:
diff --git a/pypy/module/cpyext/include/object.h 
b/pypy/module/cpyext/include/object.h
--- a/pypy/module/cpyext/include/object.h
+++ b/pypy/module/cpyext/include/object.h
@@ -7,14 +7,7 @@
 extern "C" {
 #endif
 
-/* Hack: MSVC doesn't support ssize_t */
-#ifdef _WIN32
-#define ssize_t long
-#endif
 #include <cpyext_object.h>
-#ifdef _WIN32
-#undef ssize_t
-#endif
 
 #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))
 #define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
diff --git a/pypy/module/cpyext/parse/cpyext_object.h 
b/pypy/module/cpyext/parse/cpyext_object.h
--- a/pypy/module/cpyext/parse/cpyext_object.h
+++ b/pypy/module/cpyext/parse/cpyext_object.h
@@ -1,5 +1,5 @@
 
-typedef ssize_t Py_ssize_t;
+typedef long Py_ssize_t;
 
 #define PyObject_HEAD  \
     Py_ssize_t ob_refcnt;        \
diff --git a/pypy/module/cpyext/test/test_borrow.py 
b/pypy/module/cpyext/test/test_borrow.py
--- a/pypy/module/cpyext/test/test_borrow.py
+++ b/pypy/module/cpyext/test/test_borrow.py
@@ -12,13 +12,13 @@
                 PyObject *t = PyTuple_New(1);
                 PyObject *f = PyFloat_FromDouble(42.0);
                 PyObject *g = NULL;
-                printf("Refcnt1: %zd\\n", f->ob_refcnt);
+                printf("Refcnt1: %ld\\n", f->ob_refcnt);
                 PyTuple_SetItem(t, 0, f); // steals reference
-                printf("Refcnt2: %zd\\n", f->ob_refcnt);
+                printf("Refcnt2: %ld\\n", f->ob_refcnt);
                 f = PyTuple_GetItem(t, 0); // borrows reference
-                printf("Refcnt3: %zd\\n", f->ob_refcnt);
+                printf("Refcnt3: %ld\\n", f->ob_refcnt);
                 g = PyTuple_GetItem(t, 0); // borrows reference again
-                printf("Refcnt4: %zd\\n", f->ob_refcnt);
+                printf("Refcnt4: %ld\\n", f->ob_refcnt);
                 printf("COMPARE: %i\\n", f == g);
                 fflush(stdout);
                 Py_DECREF(t);
diff --git a/pypy/module/cpyext/test/test_cpyext.py 
b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -646,7 +646,7 @@
             refcnt_after = true_obj->ob_refcnt;
             Py_DECREF(true_obj);
             Py_DECREF(true_obj);
-            fprintf(stderr, "REFCNT %zd %zd\\n", refcnt, refcnt_after);
+            fprintf(stderr, "REFCNT %ld %ld\\n", refcnt, refcnt_after);
             return PyBool_FromLong(refcnt_after == refcnt + 2);
         }
         static PyObject* foo_bar(PyObject* self, PyObject *args)
@@ -662,7 +662,7 @@
                 return NULL;
             refcnt_after = true_obj->ob_refcnt;
             Py_DECREF(tup);
-            fprintf(stderr, "REFCNT2 %zd %zd %zd\\n", refcnt, refcnt_after,
+            fprintf(stderr, "REFCNT2 %ld %ld %ld\\n", refcnt, refcnt_after,
                     true_obj->ob_refcnt);
             return PyBool_FromLong(refcnt_after == refcnt + 1 &&
                                    refcnt == true_obj->ob_refcnt);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to