提交 7a80f26f 编写于 作者: O olefirenque

fix: get rid of MREMAP_MAYMOVE flag in __mremap

Signed-off-by: Nolefirenque <olefirenko.egor@huawei-partners.com>
上级 078bd5f8
......@@ -827,10 +827,16 @@ void *realloc(void *p, size_t n)
}
newlen = (newlen + PAGE_SIZE-1) & -PAGE_SIZE;
if (oldlen == newlen) return p;
#ifndef MUSL_ITERATE_AND_STATS_API
base = __mremap(base, oldlen, newlen, MREMAP_MAYMOVE);
#else
base = __mremap(base, oldlen, newlen, 0);
#endif
if (base == (void *)-1)
goto copy_realloc;
#ifndef MUSL_ITERATE_AND_STATS_API
self = (void *)(base + extra);
#endif
self->csize = newlen - extra;
#ifdef MALLOC_RED_ZONE
self->usize = user_size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册