mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-26 20:51:11 +00:00
malloc: Simplify __mtag_tag_new_usable
The chunk cannot be a dumped one here. The only non-obvious cases are free and realloc which may be called on a dumped area chunk, but in both cases it can be verified that tagging is already avoided for dumped area chunks. Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
parent
0ae773bba0
commit
91e5c439d3
@ -298,11 +298,6 @@ __mtag_tag_new_usable (void *ptr)
|
||||
if (ptr)
|
||||
{
|
||||
mchunkptr cp = mem2chunk(ptr);
|
||||
/* This likely will never happen, but we can't handle retagging
|
||||
chunks from the dumped main arena. So just return the
|
||||
existing pointer. */
|
||||
if (DUMPED_MAIN_ARENA_CHUNK (cp))
|
||||
return ptr;
|
||||
ptr = __libc_mtag_tag_region (__libc_mtag_new_tag (ptr),
|
||||
CHUNK_AVAILABLE_SIZE (cp) - CHUNK_HDR_SZ);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user