summaryrefslogtreecommitdiff
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2015-01-23 21:19:53 +0000
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2015-01-23 21:19:53 +0000
commit25e326da3d6019e27a1313adcfd04f40fe8e7f77 (patch)
tree101f889280999cff5b2cba58721a93d204e6e689 /Python/marshal.c
parent602523212f6e8c403c43001bbee92623602ecce1 (diff)
parent8dd2d03028fc496557f4ab52e6fa36c119773236 (diff)
downloadcpython-25e326da3d6019e27a1313adcfd04f40fe8e7f77.tar.gz
Closes #23305: Merged documentation fix from 3.4.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index bb5faf3297..3832085ead 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -13,15 +13,13 @@
#include "code.h"
#include "marshal.h"
-#define ABS(x) ((x) < 0 ? -(x) : (x))
-
/* High water mark to determine when the marshalled object is dangerously deep
* and risks coring the interpreter. When the object stack gets this deep,
* raise an exception instead of continuing.
* On Windows debug builds, reduce this value.
*/
#if defined(MS_WINDOWS) && defined(_DEBUG)
-#define MAX_MARSHAL_STACK_DEPTH 1500
+#define MAX_MARSHAL_STACK_DEPTH 1000
#else
#define MAX_MARSHAL_STACK_DEPTH 2000
#endif
@@ -192,7 +190,7 @@ w_PyLong(const PyLongObject *ob, char flag, WFILE *p)
}
/* set l to number of base PyLong_MARSHAL_BASE digits */
- n = ABS(Py_SIZE(ob));
+ n = Py_ABS(Py_SIZE(ob));
l = (n-1) * PyLong_MARSHAL_RATIO;
d = ob->ob_digit[n-1];
assert(d != 0); /* a PyLong is always normalized */
@@ -727,8 +725,8 @@ r_PyLong(RFILE *p)
return NULL;
}
- size = 1 + (ABS(n) - 1) / PyLong_MARSHAL_RATIO;
- shorts_in_top_digit = 1 + (ABS(n) - 1) % PyLong_MARSHAL_RATIO;
+ size = 1 + (Py_ABS(n) - 1) / PyLong_MARSHAL_RATIO;
+ shorts_in_top_digit = 1 + (Py_ABS(n) - 1) % PyLong_MARSHAL_RATIO;
ob = _PyLong_New(size);
if (ob == NULL)
return NULL;