mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
malloc: Use different tag after mremap
The comment explained why different tag is used after mremap, but for that correctly tagged pointer should be passed to tag_new_usable. Use chunk2mem to get the tag. Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
@ -3411,7 +3411,7 @@ __libc_realloc (void *oldmem, size_t bytes)
|
|||||||
newp = mremap_chunk (oldp, nb);
|
newp = mremap_chunk (oldp, nb);
|
||||||
if (newp)
|
if (newp)
|
||||||
{
|
{
|
||||||
void *newmem = chunk2rawmem (newp);
|
void *newmem = chunk2mem (newp);
|
||||||
/* Give the new block a different tag. This helps to ensure
|
/* Give the new block a different tag. This helps to ensure
|
||||||
that stale handles to the previous mapping are not
|
that stale handles to the previous mapping are not
|
||||||
reused. There's a performance hit for both us and the
|
reused. There's a performance hit for both us and the
|
||||||
|
Reference in New Issue
Block a user