/freebsd/contrib/llvm-project/compiler-rt/lib/gwp_asan/ |
H A D | guarded_pool_allocator.cpp | 34 uintptr_t getPageAddr(uintptr_t Ptr, uintptr_t PageSize) { in getPageAddr() argument 35 return Ptr & ~(PageSize - 1); in getPageAddr() 74 const size_t PageSize = getPlatformPageSize(); in init() local 76 assert((PageSize & (PageSize - 1)) == 0); in init() 77 State.PageSize = PageSize; in init() 87 PageSize * (2 + State.MaxSimultaneousAllocations) + in init() 89 assert(PoolBytesRequired % PageSize == 0); in init() 93 roundUpTo(State.MaxSimultaneousAllocations * sizeof(*Metadata), PageSize); in init() 99 State.MaxSimultaneousAllocations * sizeof(*FreeSlots), PageSize); in init() 153 State.PageSize)); in uninitTestOnly() [all …]
|
H A D | common.cpp | 75 size_t AllocatorState::maximumAllocationSize() const { return PageSize; } in maximumAllocationSize() 78 return GuardedPagePool + (PageSize * (1 + N)) + (maximumAllocationSize() * N); in slotToAddr() 83 size_t PageOffsetFromPoolStart = (Ptr - GuardedPagePool) / PageSize; in isGuardPage() 84 size_t PagesPerSlot = maximumAllocationSize() / PageSize; in isGuardPage() 91 (State->maximumAllocationSize() + State->PageSize); in addrToSlot() 95 if (Ptr <= GuardedPagePool + PageSize) in getNearestSlot() 97 if (Ptr > GuardedPagePoolEnd - PageSize) in getNearestSlot() 103 if (Ptr % PageSize <= PageSize / 2) in getNearestSlot() 104 return addrToSlot(this, Ptr - PageSize); // Round down. in getNearestSlot() 105 return addrToSlot(this, Ptr + PageSize); // Round up. in getNearestSlot()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/scudo/standalone/ |
H A D | release.h | 392 PageSize = getPageSizeCached(); in BlockSize() 393 if (BlockSize <= PageSize) { in BlockSize() 394 if (PageSize % BlockSize == 0) { in BlockSize() 396 FullPagesBlockCountMax = PageSize / BlockSize; in BlockSize() 398 } else if (BlockSize % (PageSize % BlockSize) == 0) { in BlockSize() 402 FullPagesBlockCountMax = PageSize / BlockSize + 1; in BlockSize() 407 FullPagesBlockCountMax = PageSize / BlockSize + 2; in BlockSize() 411 if (BlockSize % PageSize == 0) { in BlockSize() 430 PagesCount = roundUp(ReleaseSize, PageSize) / PageSize; in ensurePageMapAllocated() 601 uptr PageSize; global() member 616 const uptr PageSize = Context.PageSize; releaseFreeMemoryToOS() local [all...] |
H A D | secondary.h | 125 const uptr PageSize = getPageSizeCached(); in mapSecondary() local 133 if (useMemoryTagging<Config>(Options) && isAligned(TaggedSize, PageSize)) { in mapSecondary() 147 const uptr MaxUnusedCacheBytes = MaxUnusedCachePages * PageSize; in mapSecondary() 300 const uptr PageSize = getPageSizeCached(); in retrieve() local 326 AllocPos > CommitBase + PageSize * MaxUnusedCachePages) { in retrieve() 593 const uptr PageSize = getPageSizeCached(); in allocate() local 597 const uptr MinNeededSizeForCache = roundUp(Size + getHeadersSize(), PageSize); in allocate() 599 if (Alignment < PageSize && Cache.canCache(MinNeededSizeForCache)) { in allocate() 629 roundUp(roundUp(Size, Alignment) + getHeadersSize(), PageSize); in allocate() 630 if (Alignment > PageSize) in allocate() [all …]
|
H A D | primary64.h | 82 const uptr PageSize = getPageSizeCached(); in init() local 84 const uptr PagesInGroup = GroupSize / PageSize; in init() 597 const uptr PageSize = getPageSizeCached(); in isSmallBlock() local 598 return BlockSize < PageSize / 16U; in isSmallBlock() 602 const uptr PageSize = getPageSizeCached(); in isLargeBlock() local 603 return BlockSize > PageSize; in isLargeBlock() 612 const uptr PageSize = getPageSizeCached(); in initRegion() local 619 (getRandomModN(&Region->RandState, 16) + 1) * PageSize; in initRegion() 625 Region->TryReleaseThreshold = PageSize * SmallerBlockReleasePageDelta; in initRegion() 627 Region->TryReleaseThreshold = PageSize; in initRegion() [all …]
|
H A D | wrappers_c_checks.h | 64 inline bool checkForPvallocOverflow(uptr Size, uptr PageSize) { in checkForPvallocOverflow() argument 65 return roundUp(Size, PageSize) < Size; in checkForPvallocOverflow()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/gwp_asan/platform_specific/ |
H A D | guarded_pool_allocator_posix.cpp | 46 assert((Size % State.PageSize) == 0); in map() 55 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in unmap() 56 assert((Size % State.PageSize) == 0); in unmap() 62 assert((Size % State.PageSize) == 0); in reserveGuardedPool() 76 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in allocateInGuardedPool() 77 assert((Size % State.PageSize) == 0); in allocateInGuardedPool() 85 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in deallocateInGuardedPool() 86 assert((Size % State.PageSize) == 0); in deallocateInGuardedPool()
|
H A D | guarded_pool_allocator_fuchsia.cpp | 24 assert((Size % State.PageSize) == 0); in map() 39 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in unmap() 40 assert((Size % State.PageSize) == 0); in unmap() 47 assert((Size % State.PageSize) == 0); in reserveGuardedPool() 68 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in allocateInGuardedPool() 69 assert((Size % State.PageSize) == 0); in allocateInGuardedPool() 90 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in deallocateInGuardedPool() 91 assert((Size % State.PageSize) == 0); in deallocateInGuardedPool()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/xray/ |
H A D | xray_interface.cpp | 106 std::size_t PageSize) XRAY_NEVER_INSTRUMENT in MProtectHelper() argument 111 MProtectLen = RoundUpTo(MProtectLen, PageSize); in MProtectHelper() 311 const size_t PageSize = flags()->xray_page_size_override > 0 in controlPatching() local 314 if ((PageSize == 0) || ((PageSize & (PageSize - 1)) != 0)) { in controlPatching() 315 Report("System page size is not a power of two: %zu\n", PageSize); in controlPatching() 320 reinterpret_cast<void *>(MinSled->address() & ~(PageSize - 1)); in controlPatching() 324 MProtectHelper Protector(PageAlignedAddr, MProtectLen, PageSize); in controlPatching() 362 const size_t PageSize = flags()->xray_page_size_override > 0 in mprotectAndPatchFunction() local 365 if ((PageSize == 0) || ((PageSize & (PageSize - 1)) != 0)) { in mprotectAndPatchFunction() 366 Report("Provided page size is not a power of two: %zu\n", PageSize); in mprotectAndPatchFunction() [all …]
|
H A D | xray_utils.cpp | 54 const size_t PageSize = flags()->xray_page_size_override > 0 in WriteAll() local 57 if (RoundUpTo(Offset, PageSize) != RoundUpTo(Offset + TotalBytes, PageSize)) { in WriteAll()
|
/freebsd/contrib/llvm-project/llvm/lib/ObjCopy/MachO/ |
H A D | MachOWriter.h | 28 uint64_t PageSize; variable 63 StringRef OutputFileName, uint64_t PageSize, raw_ostream &Out) in MachOWriter() argument 65 PageSize(PageSize), Out(Out), in MachOWriter() 66 LayoutBuilder(O, Is64Bit, OutputFileName, PageSize) {} in MachOWriter()
|
H A D | MachOLayoutBuilder.h | 60 uint64_t PageSize; variable 80 uint64_t PageSize) in MachOLayoutBuilder() argument 82 PageSize(PageSize), in MachOLayoutBuilder()
|
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/Orc/ |
H A D | MemoryMapper.cpp | 33 InProcessMemoryMapper::InProcessMemoryMapper(size_t PageSize) in InProcessMemoryMapper() argument 34 : PageSize(PageSize) {} in InProcessMemoryMapper() 38 auto PageSize = sys::Process::getPageSize(); in Create() local 39 if (!PageSize) in Create() 40 return PageSize.takeError(); in Create() 41 return std::make_unique<InProcessMemoryMapper>(*PageSize); in Create() 198 SymbolAddrs SAs, size_t PageSize) in SharedMemoryMapper() argument 199 : EPC(EPC), SAs(SAs), PageSize(PageSize) { in SharedMemoryMapper() 208 auto PageSize = sys::Process::getPageSize(); in Create() local 209 if (!PageSize) in Create() [all …]
|
H A D | ExecutorProcessControl.cpp | 30 Triple TargetTriple, unsigned PageSize, in SelfExecutorProcessControl() argument 41 this->PageSize = PageSize; in SelfExecutorProcessControl() 67 auto PageSize = sys::Process::getPageSize(); in Create() local 68 if (!PageSize) in Create() 69 return PageSize.takeError(); in Create() 74 std::move(SSP), std::move(D), std::move(TT), *PageSize, in Create()
|
H A D | EPCIndirectionUtils.cpp | 111 auto PageSize = EPC.getPageSize(); in grow() local 114 {{MemProt::Read | MemProt::Exec, {PageSize, Align(PageSize)}}}); in grow() 356 auto PageSize = EPC.getPageSize(); in getIndirectStubs() local 357 auto StubBytes = alignTo(NumStubsToAllocate * ABI->getStubSize(), PageSize); in getIndirectStubs() 360 alignTo(NumStubsToAllocate * ABI->getPointerSize(), PageSize); in getIndirectStubs() 367 {{StubProt, {static_cast<size_t>(StubBytes), Align(PageSize)}}, in getIndirectStubs() 368 {PtrProt, {static_cast<size_t>(PtrBytes), Align(PageSize)}}}); in getIndirectStubs()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/ |
H A D | MemoryMapper.h | 84 InProcessMemoryMapper(size_t PageSize); 88 unsigned int getPageSize() override { return PageSize; } in getPageSize() 121 size_t PageSize; variable 135 size_t PageSize); 140 unsigned int getPageSize() override { return PageSize; } in getPageSize() 169 size_t PageSize; variable
|
/freebsd/contrib/llvm-project/llvm/lib/Support/Unix/ |
H A D | Memory.inc | 108 static const size_t PageSize = Process::getPageSizeEstimate(); 109 const size_t NumPages = (NumBytes + PageSize - 1) / PageSize; 111 if (Start && Start % PageSize) 112 Start += PageSize - Start % PageSize; 115 void *Addr = ::mmap(reinterpret_cast<void *>(Start), PageSize * NumPages, 138 Result.AllocatedSize = PageSize * NumPages; 166 static const Align PageSize = Align(Process::getPageSizeEstimate()); 175 alignAddr((const uint8_t *)M.Address - PageSize.value() + 1, PageSize); 177 alignAddr((const uint8_t *)M.Address + M.AllocatedSize, PageSize);
|
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/ |
H A D | SectionMemoryManager.cpp | 183 static const size_t PageSize = sys::Process::getPageSizeEstimate(); in trimBlockToPageSize() local 186 (PageSize - ((uintptr_t)M.base() % PageSize)) % PageSize; in trimBlockToPageSize() 190 TrimmedSize -= TrimmedSize % PageSize; in trimBlockToPageSize() 195 assert(((uintptr_t)Trimmed.base() % PageSize) == 0); in trimBlockToPageSize() 196 assert((Trimmed.allocatedSize() % PageSize) == 0); in trimBlockToPageSize()
|
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/JITLink/ |
H A D | JITLinkMemoryManager.cpp | 81 BasicLayout::getContiguousPageBasedLayoutSizes(uint64_t PageSize) { in getContiguousPageBasedLayoutSizes() argument 88 if (Seg.Alignment > PageSize) in getContiguousPageBasedLayoutSizes() 92 uint64_t SegSize = alignTo(Seg.ContentSize + Seg.ZeroFillSize, PageSize); in getContiguousPageBasedLayoutSizes() 310 alignTo(Seg.ContentSize + Seg.ZeroFillSize, MemMgr.PageSize); in applyProtections() 329 if (auto PageSize = sys::Process::getPageSize()) in Create() local 330 return std::make_unique<InProcessMemoryManager>(*PageSize); in Create() 332 return PageSize.takeError(); in Create() 339 if (!isPowerOf2_64((uint64_t)PageSize)) { in allocate() 349 auto SegsSizes = BL.getContiguousPageBasedLayoutSizes(PageSize); in allocate() 429 SegAddr += alignTo(Seg.ContentSize + Seg.ZeroFillSize, PageSize); in allocate()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/ |
H A D | Process.h | 62 if (auto PageSize = getPageSize()) in getPageSizeEstimate() local 63 return *PageSize; in getPageSizeEstimate() 65 consumeError(PageSize.takeError()); in getPageSizeEstimate()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/profile/ |
H A D | InstrProfilingBuffer.c | 26 static unsigned PageSize = 0; variable 29 return ContinuouslySyncProfile && PageSize; in __llvm_profile_is_continuous_mode_enabled() 41 PageSize = PS; in __llvm_profile_set_page_size() 133 uint64_t OffsetModPage = Offset % PageSize; in calculateBytesNeededToPageAlign() 135 return PageSize - OffsetModPage; in calculateBytesNeededToPageAlign()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/Shared/ |
H A D | SimpleRemoteEPCUtils.h | 47 uint64_t PageSize; member 211 SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols); in size() 217 OB, SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols); in serialize() 222 IB, SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols); in deserialize()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/JITLink/ |
H A D | JITLinkMemoryManager.h | 267 getContiguousPageBasedLayoutSizes(uint64_t PageSize); 366 InProcessMemoryManager(uint64_t PageSize) : PageSize(PageSize) {} in InProcessMemoryManager() argument 392 uint64_t PageSize; variable
|
/freebsd/contrib/llvm-project/compiler-rt/lib/dfsan/ |
H A D | dfsan_allocator.cpp | 247 uptr PageSize = GetPageSizeCached(); in dfsan_pvalloc() local 248 if (UNLIKELY(CheckForPvallocOverflow(size, PageSize))) { in dfsan_pvalloc() 256 size = size ? RoundUpTo(size, PageSize) : PageSize; in dfsan_pvalloc() 257 return SetErrnoOnNull(DFsanAllocate(size, PageSize, false /*zeroise*/)); in dfsan_pvalloc()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/fuzzer/ |
H A D | FuzzerUtil.h | 99 size_t PageSize(); in RoundUpByPage() 103 size_t Mask = PageSize() - 1; in RoundUpByPage() 109 size_t Mask = PageSize() - 1; in RoundDownByPage()
|