@@ -1914,7 +1914,7 @@ static void *
|
1914 | 1914 | _PyMem_DebugRawRealloc(void *ctx, void *p, size_t nbytes) |
1915 | 1915 | { |
1916 | 1916 | debug_alloc_api_t *api = (debug_alloc_api_t *)ctx; |
1917 | | -uint8_t *q = (uint8_t *)p, *oldq; |
| 1917 | +uint8_t *q = (uint8_t *)p; |
1918 | 1918 | uint8_t *tail; |
1919 | 1919 | size_t total; /* nbytes + 4*SST */ |
1920 | 1920 | size_t original_nbytes; |
@@ -1931,20 +1931,11 @@ _PyMem_DebugRawRealloc(void *ctx, void *p, size_t nbytes)
|
1931 | 1931 | /* overflow: can't represent total as a Py_ssize_t */ |
1932 | 1932 | return NULL; |
1933 | 1933 | |
1934 | | -/* Resize and add decorations. We may get a new pointer here, in which |
1935 | | - * case we didn't get the chance to mark the old memory with DEADBYTE, |
1936 | | - * but we live with that. |
1937 | | - */ |
1938 | | -oldq = q; |
| 1934 | +/* Resize and add decorations. */ |
1939 | 1935 | q = (uint8_t *)api->alloc.realloc(api->alloc.ctx, q - 2*SST, total); |
1940 | 1936 | if (q == NULL) |
1941 | 1937 | return NULL; |
1942 | 1938 | |
1943 | | -if (q == oldq && nbytes < original_nbytes) { |
1944 | | -/* shrinking: mark old extra memory dead */ |
1945 | | -memset(q + nbytes, DEADBYTE, original_nbytes - nbytes); |
1946 | | - } |
1947 | | - |
1948 | 1939 | write_size_t(q, nbytes); |
1949 | 1940 | assert(q[SST] == (uint8_t)api->api_id); |
1950 | 1941 | for (i = 1; i < SST; ++i) |
|