[PATCH] D69675: [scudo][standalone] Fix Secondary bug w/ freelist
Matt Morehouse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 31 11:56:49 PDT 2019
morehouse accepted this revision.
morehouse added inline comments.
This revision is now accepted and ready to land.
================
Comment at: compiler-rt/lib/scudo/standalone/secondary.h:141
+ if (ZeroContents)
+ memset(Ptr, 0, H.BlockEnd - reinterpret_cast<uptr>(Ptr));
+ return Ptr;
----------------
cryptoad wrote:
> morehouse wrote:
> > We currently release unconditionally in `deallocate`. Does this zero-out the memory?
> >
> > If so, we might only need to zero the first page here, not the whole allocation.
> You are correct, we could technically `memset` only the portion before the first page boundary.
> As you also said it's the current as I want to move the release to abide by `release_to_os_interval_ms`
> This would mean that eventually it could not have been released prior to reallocation.
> At this point I'd rather not take a shortcut because I feel it's going to come back to me later on.
Sounds good as long as the memset doesn't negate the perf improvemnt from using a free list.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69675/new/
https://reviews.llvm.org/D69675
More information about the llvm-commits
mailing list