Commit 2dfc5e8b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

version up: Python 2.7.17.

parent a7a86db9
...@@ -29,9 +29,9 @@ python = python2.7 ...@@ -29,9 +29,9 @@ python = python2.7
[python2.7] [python2.7]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
package_version = 2.7.15 package_version = 2.7.17
package_version_suffix = package_version_suffix =
md5sum = a80ae3cc478460b922242f43a1b4094d md5sum = b3b6d2c92f42a60667814358ab9f0cfd
# This is actually the default setting for prefix, but we can't use it in # This is actually the default setting for prefix, but we can't use it in
# other settings in this part if we don't set it explicitly here. # other settings in this part if we don't set it explicitly here.
...@@ -42,7 +42,7 @@ executable = ${:prefix}/bin/python${:version} ...@@ -42,7 +42,7 @@ executable = ${:prefix}/bin/python${:version}
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/fix_compiler_module_issue_20613.patch#94443a77f903e9de880a029967fa6aa7 ${:_profile_base_location_}/fix_compiler_module_issue_20613.patch#94443a77f903e9de880a029967fa6aa7
${:_profile_base_location_}/pytracemalloc_pep445.patch#3dfad79654af9671325f988c36fb6be2 ${:_profile_base_location_}/pytracemalloc_pep445.patch#9f3145817afa2b7fad801fde8447e396
${:_profile_base_location_}/disabled_module_list.patch#71ad30d32bcdbc50c19cf48675b1246e ${:_profile_base_location_}/disabled_module_list.patch#71ad30d32bcdbc50c19cf48675b1246e
${:_profile_base_location_}/asyncore_poll_insteadof_select.patch#ab6991c0ee6e25aeb8951e71f280a2f1 ${:_profile_base_location_}/asyncore_poll_insteadof_select.patch#ab6991c0ee6e25aeb8951e71f280a2f1
url = url =
......
...@@ -492,7 +492,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -492,7 +492,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
#ifdef WITH_PYMALLOC #ifdef WITH_PYMALLOC
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
@@ -214,7 +489,7 @@ @@ -220,7 +495,7 @@
* Arenas are allocated with mmap() on systems supporting anonymous memory * Arenas are allocated with mmap() on systems supporting anonymous memory
* mappings to reduce heap fragmentation. * mappings to reduce heap fragmentation.
*/ */
...@@ -501,7 +501,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -501,7 +501,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
#ifdef WITH_MEMORY_LIMITS #ifdef WITH_MEMORY_LIMITS
#define MAX_ARENAS (SMALL_MEMORY_LIMIT / ARENA_SIZE) #define MAX_ARENAS (SMALL_MEMORY_LIMIT / ARENA_SIZE)
@@ -581,7 +856,7 @@ @@ -587,7 +862,7 @@
return NULL; /* overflow */ return NULL; /* overflow */
#endif #endif
nbytes = numarenas * sizeof(*arenas); nbytes = numarenas * sizeof(*arenas);
...@@ -510,7 +510,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -510,7 +510,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
if (arenaobj == NULL) if (arenaobj == NULL)
return NULL; return NULL;
arenas = arenaobj; arenas = arenaobj;
@@ -785,9 +1060,8 @@ @@ -791,9 +1066,8 @@
* Unless the optimizer reorders everything, being too smart... * Unless the optimizer reorders everything, being too smart...
*/ */
...@@ -522,7 +522,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -522,7 +522,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
{ {
block *bp; block *bp;
poolp pool; poolp pool;
@@ -802,15 +1076,6 @@ @@ -808,15 +1082,6 @@
#endif #endif
/* /*
...@@ -538,7 +538,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -538,7 +538,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
* This implicitly redirects malloc(0). * This implicitly redirects malloc(0).
*/ */
if ((nbytes - 1) < SMALL_REQUEST_THRESHOLD) { if ((nbytes - 1) < SMALL_REQUEST_THRESHOLD) {
@@ -981,17 +1246,13 @@ @@ -987,17 +1252,13 @@
* last chance to serve the request) or when the max memory limit * last chance to serve the request) or when the max memory limit
* has been reached. * has been reached.
*/ */
...@@ -559,7 +559,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -559,7 +559,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
{ {
poolp pool; poolp pool;
block *lastfree; block *lastfree;
@@ -1211,7 +1472,7 @@ @@ -1217,7 +1478,7 @@
redirect: redirect:
#endif #endif
/* We didn't allocate this address. */ /* We didn't allocate this address. */
...@@ -568,7 +568,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -568,7 +568,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
} }
/* realloc. If p is NULL, this acts like malloc(nbytes). Else if nbytes==0, /* realloc. If p is NULL, this acts like malloc(nbytes). Else if nbytes==0,
@@ -1219,10 +1480,8 @@ @@ -1225,10 +1486,8 @@
* return a non-NULL result. * return a non-NULL result.
*/ */
...@@ -581,7 +581,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -581,7 +581,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
{ {
void *bp; void *bp;
poolp pool; poolp pool;
@@ -1232,16 +1491,7 @@ @@ -1238,16 +1497,7 @@
#endif #endif
if (p == NULL) if (p == NULL)
...@@ -599,7 +599,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -599,7 +599,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
#ifdef WITH_VALGRIND #ifdef WITH_VALGRIND
/* Treat running_on_valgrind == -1 the same as 0 */ /* Treat running_on_valgrind == -1 the same as 0 */
@@ -1269,10 +1519,10 @@ @@ -1275,10 +1525,10 @@
} }
size = nbytes; size = nbytes;
} }
...@@ -612,7 +612,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -612,7 +612,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
} }
return bp; return bp;
} }
@@ -1290,40 +1540,17 @@ @@ -1296,40 +1546,17 @@
* at p. Instead we punt: let C continue to manage this block. * at p. Instead we punt: let C continue to manage this block.
*/ */
if (nbytes) if (nbytes)
...@@ -655,7 +655,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -655,7 +655,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
#endif /* WITH_PYMALLOC */ #endif /* WITH_PYMALLOC */
#ifdef PYMALLOC_DEBUG #ifdef PYMALLOC_DEBUG
@@ -1343,10 +1570,6 @@ @@ -1349,10 +1576,6 @@
#define DEADBYTE 0xDB /* dead (newly freed) memory */ #define DEADBYTE 0xDB /* dead (newly freed) memory */
#define FORBIDDENBYTE 0xFB /* untouchable bytes at each end of a block */ #define FORBIDDENBYTE 0xFB /* untouchable bytes at each end of a block */
...@@ -666,7 +666,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -666,7 +666,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
static size_t serialno = 0; /* incremented on each debug {m,re}alloc */ static size_t serialno = 0; /* incremented on each debug {m,re}alloc */
/* serialno is always incremented via calling this routine. The point is /* serialno is always incremented via calling this routine. The point is
@@ -1429,58 +1652,18 @@ @@ -1467,58 +1690,18 @@
p[2*S+n: 2*S+n+S] p[2*S+n: 2*S+n+S]
Copies of FORBIDDENBYTE. Used to catch over- writes and reads. Copies of FORBIDDENBYTE. Used to catch over- writes and reads.
p[2*S+n+S: 2*S+n+2*S] p[2*S+n+S: 2*S+n+2*S]
...@@ -722,7 +722,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -722,7 +722,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
- -
-/* generic debug memory api, with an "id" to identify the API in use */ -/* generic debug memory api, with an "id" to identify the API in use */
-void * -void *
-_PyObject_DebugMallocApi(char id, size_t nbytes) -_PyObject_DebugMallocApi(char api, size_t nbytes)
+static void * +static void *
+_PyMem_DebugMallocCtx(void *ctx, size_t nbytes) +_PyMem_DebugMallocCtx(void *ctx, size_t nbytes)
{ {
...@@ -730,25 +730,27 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -730,25 +730,27 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
uchar *p; /* base address of malloc'ed block */ uchar *p; /* base address of malloc'ed block */
uchar *tail; /* p + 2*SST + nbytes == pointer to tail pad bytes */ uchar *tail; /* p + 2*SST + nbytes == pointer to tail pad bytes */
size_t total; /* nbytes + 4*SST */ size_t total; /* nbytes + 4*SST */
@@ -1491,14 +1674,14 @@ @@ -1530,7 +1713,7 @@
/* overflow: can't represent total as a size_t */
return NULL; return NULL;
if (api == _PYMALLOC_OBJ_ID) {
- p = (uchar *)PyObject_Malloc(total); - p = (uchar *)PyObject_Malloc(total);
+ p = (uchar *)api->alloc.malloc(api->alloc.ctx, total); + p = (uchar *)api->alloc.malloc(api->alloc.ctx, total);
if (p == NULL) }
return NULL; else {
p = (uchar *)_PyMem_Malloc(total);
@@ -1540,8 +1723,8 @@
/* at p, write size (SST bytes), id (1 byte), pad (SST-1 bytes) */ /* at p, write size (SST bytes), api (1 byte), pad (SST-1 bytes) */
write_size_t(p, nbytes); write_size_t(p, nbytes);
- p[SST] = (uchar)id; - p[SST] = (uchar)api;
- memset(p + SST + 1 , FORBIDDENBYTE, SST-1); - memset(p + SST + 1 , FORBIDDENBYTE, SST-1);
+ p[SST] = (uchar)api->api_id; + p[SST] = (uchar)api->api_id;
+ memset(p + SST + 1, FORBIDDENBYTE, SST-1); + memset(p + SST + 1, FORBIDDENBYTE, SST-1);
if (nbytes > 0) if (nbytes > 0)
memset(p + 2*SST, CLEANBYTE, nbytes); memset(p + 2*SST, CLEANBYTE, nbytes);
@@ -1516,35 +1699,37 @@ @@ -1559,40 +1742,42 @@
Then fills the original bytes with DEADBYTE. Then fills the original bytes with DEADBYTE.
Then calls the underlying free. Then calls the underlying free.
*/ */
...@@ -769,9 +771,14 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -769,9 +771,14 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
nbytes += 4*SST; nbytes += 4*SST;
if (nbytes > 0) if (nbytes > 0)
memset(q, DEADBYTE, nbytes); memset(q, DEADBYTE, nbytes);
if (api == _PYMALLOC_OBJ_ID) {
- PyObject_Free(q); - PyObject_Free(q);
+ api->alloc.free(api->alloc.ctx, q); + api->alloc.free(api->alloc.ctx, q);
} }
else {
_PyMem_Free(q);
}
}
-void * -void *
-_PyObject_DebugReallocApi(char api, void *p, size_t nbytes) -_PyObject_DebugReallocApi(char api, void *p, size_t nbytes)
...@@ -795,7 +802,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -795,7 +802,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
bumpserialno(); bumpserialno();
original_nbytes = read_size_t(q - 2*SST); original_nbytes = read_size_t(q - 2*SST);
total = nbytes + 4*SST; total = nbytes + 4*SST;
@@ -1552,16 +1737,12 @@ @@ -1600,17 +1785,13 @@
/* overflow: can't represent total as a size_t */ /* overflow: can't represent total as a size_t */
return NULL; return NULL;
...@@ -808,13 +815,14 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -808,13 +815,14 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
* case we didn't get the chance to mark the old memory with DEADBYTE, * case we didn't get the chance to mark the old memory with DEADBYTE,
* but we live with that. * but we live with that.
*/ */
if (api == _PYMALLOC_OBJ_ID) {
- q = (uchar *)PyObject_Realloc(q - 2*SST, total); - q = (uchar *)PyObject_Realloc(q - 2*SST, total);
+ oldq = q; + oldq = q;
+ q = (uchar *)api->alloc.realloc(api->alloc.ctx, q - 2*SST, total); + q = (uchar *)api->alloc.realloc(api->alloc.ctx, q - 2*SST, total);
if (q == NULL) { }
if (nbytes <= original_nbytes) { else {
/* bpo-31626: the memset() above expects that realloc never fails q = (uchar *)_PyMem_Realloc(q - 2*SST, total);
@@ -1571,11 +1752,17 @@ @@ -1624,11 +1805,17 @@
return NULL; return NULL;
} }
...@@ -833,7 +841,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -833,7 +841,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
tail = q + nbytes; tail = q + nbytes;
memset(tail, FORBIDDENBYTE, SST); memset(tail, FORBIDDENBYTE, SST);
write_size_t(tail + SST, serialno); write_size_t(tail + SST, serialno);
@@ -1594,8 +1781,8 @@ @@ -1647,8 +1834,8 @@
* and call Py_FatalError to kill the program. * and call Py_FatalError to kill the program.
* The API id, is also checked. * The API id, is also checked.
*/ */
...@@ -844,7 +852,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c ...@@ -844,7 +852,7 @@ diff -Naru a/Objects/obmalloc.c b/Objects/obmalloc.c
{ {
const uchar *q = (const uchar *)p; const uchar *q = (const uchar *)p;
char msgbuf[64]; char msgbuf[64];
@@ -1941,3 +2128,44 @@ @@ -1994,3 +2181,44 @@
arenas[arenaindex_temp].address != 0; arenas[arenaindex_temp].address != 0;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment