@@ -1460,7 +1460,7 @@ static void *
|
1460 | 1460 | _PyMem_DebugRawRealloc(void *ctx, void *p, size_t nbytes) |
1461 | 1461 | { |
1462 | 1462 | debug_alloc_api_t *api = (debug_alloc_api_t *)ctx; |
1463 | | - uint8_t *q = (uint8_t *)p, *oldq; |
| 1463 | + uint8_t *q = (uint8_t *)p; |
1464 | 1464 | uint8_t *tail; |
1465 | 1465 | size_t total; /* nbytes + 4*SST */ |
1466 | 1466 | size_t original_nbytes; |
@@ -1477,20 +1477,11 @@ _PyMem_DebugRawRealloc(void *ctx, void *p, size_t nbytes)
|
1477 | 1477 | /* overflow: can't represent total as a Py_ssize_t */ |
1478 | 1478 | return NULL; |
1479 | 1479 | |
1480 | | - /* Resize and add decorations. We may get a new pointer here, in which |
1481 | | - * case we didn't get the chance to mark the old memory with DEADBYTE, |
1482 | | - * but we live with that. |
1483 | | - */ |
1484 | | - oldq = q; |
| 1480 | + /* Resize and add decorations. */ |
1485 | 1481 | q = (uint8_t *)api->alloc.realloc(api->alloc.ctx, q - 2*SST, total); |
1486 | 1482 | if (q == NULL) |
1487 | 1483 | return NULL; |
1488 | 1484 | |
1489 | | - if (q == oldq && nbytes < original_nbytes) { |
1490 | | - /* shrinking: mark old extra memory dead */ |
1491 | | - memset(q + nbytes, DEADBYTE, original_nbytes - nbytes); |
1492 | | - } |
1493 | | - |
1494 | 1485 | write_size_t(q, nbytes); |
1495 | 1486 | assert(q[SST] == (uint8_t)api->api_id); |
1496 | 1487 | for (i = 1; i < SST; ++i) |
|