Home
last modified time | relevance | path

Searched refs:PageSize (Results 1 – 25 of 80) sorted by relevance

1234

/freebsd/contrib/llvm-project/llvm/include/llvm/ADT/
H A DPagedVector.h42 template <typename T, size_t PageSize = 1024 / sizeof(T)> class PagedVector {
43 static_assert(PageSize > 1, "PageSize must be greater than 0. Most likely "
84 assert(Index / PageSize < PageToDataPtrs.size());
85 T *&PagePtr = PageToDataPtrs[Index / PageSize];
88 PagePtr = Allocator.getPointer()->template Allocate<T>(PageSize);
91 std::uninitialized_value_construct_n(PagePtr, PageSize);
94 return PagePtr[Index % PageSize];
100 return PageToDataPtrs.size() * PageSize; in capacity()
130 size_t NewLastPage = (NewSize - 1) / PageSize; in resize()
137 std::destroy_n(Page, PageSize); in resize()
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/gwp_asan/
H A Dguarded_pool_allocator.cpp34 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 Dcommon.cpp75 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 Drelease.h400 const uptr PageSize = getPageSizeCached(); in BlockSize() local
401 if (BlockSize <= PageSize) { in BlockSize()
402 if (PageSize % BlockSize == 0) { in BlockSize()
404 FullPagesBlockCountMax = PageSize / BlockSize; in BlockSize()
406 } else if (BlockSize % (PageSize % BlockSize) == 0) { in BlockSize()
410 FullPagesBlockCountMax = PageSize / BlockSize + 1; in BlockSize()
415 FullPagesBlockCountMax = PageSize / BlockSize + 2; in BlockSize()
419 if ((BlockSize & (PageSize - 1)) == 0) { in BlockSize()
439 PagesCount = roundUp(ReleaseSize, PageSize) >> PageSizeLog; in BlockSize()
462 const uptr PageSize = getPageSizeCached(); in markRangeAsAllCounted() local
[all …]
H A Dsecondary.h145 const uptr PageSize = getPageSizeCached(); in mapSecondary() local
153 if (useMemoryTagging<Config>(Options) && isAligned(TaggedSize, PageSize)) { in mapSecondary()
167 const uptr MaxUnreleasedCacheBytes = MaxUnreleasedCachePages * PageSize; in mapSecondary()
363 const uptr PageSize = getPageSizeCached(); in retrieve() local
401 MaxAllowedFragmentedPages * PageSize; in retrieve()
411 const uptr Diff = roundDown(HeaderPos, PageSize) - CommitBase; in retrieve()
455 roundDown(EntryHeaderPos, PageSize) - Entry.CommitBase; in retrieve()
456 const uptr MaxUnreleasedCacheBytes = MaxUnreleasedCachePages * PageSize; in retrieve()
459 CachedBlock::MaxReleasedCachePages * PageSize; in retrieve()
463 PageSize); in retrieve()
[all …]
H A Dwrappers_c_checks.h64 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 Dguarded_pool_allocator_posix.cpp47 assert((Size % State.PageSize) == 0); in map()
57 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in unmap()
58 assert((Size % State.PageSize) == 0); in unmap()
64 assert((Size % State.PageSize) == 0); in reserveGuardedPool()
79 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in allocateInGuardedPool()
80 assert((Size % State.PageSize) == 0); in allocateInGuardedPool()
89 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in deallocateInGuardedPool()
90 assert((Size % State.PageSize) == 0); in deallocateInGuardedPool()
H A Dguarded_pool_allocator_fuchsia.cpp24 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()
71 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in allocateInGuardedPool()
72 assert((Size % State.PageSize) == 0); in allocateInGuardedPool()
93 assert((reinterpret_cast<uintptr_t>(Ptr) % State.PageSize) == 0); in deallocateInGuardedPool()
94 assert((Size % State.PageSize) == 0); in deallocateInGuardedPool()
/freebsd/contrib/llvm-project/llvm/lib/ObjCopy/MachO/
H A DMachOWriter.h28 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 DMachOLayoutBuilder.h60 uint64_t PageSize; variable
80 uint64_t PageSize) in MachOLayoutBuilder() argument
82 PageSize(PageSize), in MachOLayoutBuilder()
/freebsd/contrib/llvm-project/compiler-rt/lib/xray/
H A Dxray_interface.cpp113 std::size_t PageSize) XRAY_NEVER_INSTRUMENT in MProtectHelper() argument
118 MProtectLen = RoundUpTo(MProtectLen, PageSize); in MProtectHelper()
340 const size_t PageSize = flags()->xray_page_size_override > 0 in controlPatchingObjectUnchecked() local
343 if ((PageSize == 0) || ((PageSize & (PageSize - 1)) != 0)) { in controlPatchingObjectUnchecked()
344 Report("System page size is not a power of two: %zu\n", PageSize); in controlPatchingObjectUnchecked()
349 reinterpret_cast<void *>(MinSled->address() & ~(PageSize - 1)); in controlPatchingObjectUnchecked()
353 MProtectHelper Protector(PageAlignedAddr, MProtectLen, PageSize); in controlPatchingObjectUnchecked()
465 const size_t PageSize = flags()->xray_page_size_override > 0 in mprotectAndPatchFunction() local
468 if ((PageSize == 0) || ((PageSize & (PageSize - 1)) != 0)) { in mprotectAndPatchFunction()
469 Report("Provided page size is not a power of two: %zu\n", PageSize); in mprotectAndPatchFunction()
[all …]
H A Dxray_utils.cpp54 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/include/llvm/ExecutionEngine/Orc/
H A DMemoryMapper.h85 InProcessMemoryMapper(size_t PageSize);
89 unsigned int getPageSize() override { return PageSize; } in getPageSize()
122 size_t PageSize; variable
136 size_t PageSize);
141 unsigned int getPageSize() override { return PageSize; } in getPageSize()
171 size_t PageSize; variable
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/Orc/
H A DSelfExecutorProcessControl.cpp24 Triple TargetTriple, unsigned PageSize, in SelfExecutorProcessControl() argument
35 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 DMemoryMapper.cpp32 InProcessMemoryMapper::InProcessMemoryMapper(size_t PageSize) in InProcessMemoryMapper() argument
33 : PageSize(PageSize) {} in InProcessMemoryMapper()
37 auto PageSize = sys::Process::getPageSize(); in Create() local
38 if (!PageSize) in Create()
39 return PageSize.takeError(); in Create()
40 return std::make_unique<InProcessMemoryMapper>(*PageSize); in Create()
207 SymbolAddrs SAs, size_t PageSize) in SharedMemoryMapper() argument
208 : EPC(EPC), SAs(SAs), PageSize(PageSize) { in SharedMemoryMapper()
217 auto PageSize = sys::Process::getPageSize(); in Create() local
218 if (!PageSize) in Create()
[all …]
H A DEPCIndirectionUtils.cpp111 auto PageSize = EPC.getPageSize(); in grow() local
114 nullptr, {{MemProt::Read | MemProt::Exec, {PageSize, Align(PageSize)}}}); in grow()
357 auto PageSize = EPC.getPageSize(); in getIndirectStubs() local
358 auto StubBytes = alignTo(NumStubsToAllocate * ABI->getStubSize(), PageSize); in getIndirectStubs()
361 alignTo(NumStubsToAllocate * ABI->getPointerSize(), PageSize); in getIndirectStubs()
369 {{StubProt, {static_cast<size_t>(StubBytes), Align(PageSize)}}, in getIndirectStubs()
370 {PtrProt, {static_cast<size_t>(PtrBytes), Align(PageSize)}}}); in getIndirectStubs()
/freebsd/contrib/llvm-project/llvm/lib/Support/Unix/
H A DMemory.inc108 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 DSectionMemoryManager.cpp182 static const size_t PageSize = sys::Process::getPageSizeEstimate(); in trimBlockToPageSize() local
185 (PageSize - ((uintptr_t)M.base() % PageSize)) % PageSize; in trimBlockToPageSize()
189 TrimmedSize -= TrimmedSize % PageSize; in trimBlockToPageSize()
194 assert(((uintptr_t)Trimmed.base() % PageSize) == 0); in trimBlockToPageSize()
195 assert((Trimmed.allocatedSize() % PageSize) == 0); in trimBlockToPageSize()
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/JITLink/
H A DJITLinkMemoryManager.cpp81 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()
324 alignTo(Seg.ContentSize + Seg.ZeroFillSize, MemMgr.PageSize); in applyProtections()
343 if (auto PageSize = sys::Process::getPageSize()) { in Create() local
345 if (!isPowerOf2_64((uint64_t)*PageSize)) in Create()
348 Twine(*PageSize) + " is not a power of 2", in Create()
351 return std::make_unique<InProcessMemoryManager>(*PageSize); in Create()
353 return PageSize.takeError(); in Create()
362 auto SegsSizes = BL.getContiguousPageBasedLayoutSizes(PageSize); in allocate()
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/profile/
H A DInstrProfilingBuffer.c26 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/JITLink/
H A DJITLinkMemoryManager.h269 getContiguousPageBasedLayoutSizes(uint64_t PageSize);
371 InProcessMemoryManager(uint64_t PageSize) : PageSize(PageSize) { in InProcessMemoryManager() argument
372 assert(isPowerOf2_64(PageSize) && "PageSize must be a power of 2"); in InProcessMemoryManager()
399 uint64_t PageSize; variable
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/
H A DProcess.h63 if (auto PageSize = getPageSize()) in getPageSizeEstimate() local
64 return *PageSize; in getPageSizeEstimate()
66 consumeError(PageSize.takeError()); in getPageSizeEstimate()
/freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/Shared/
H A DSimpleRemoteEPCUtils.h48 uint64_t PageSize; member
212 SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols); in size()
218 OB, SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols); in serialize()
223 IB, SI.TargetTriple, SI.PageSize, SI.BootstrapMap, SI.BootstrapSymbols); in deserialize()
/freebsd/contrib/llvm-project/compiler-rt/lib/fuzzer/
H A DFuzzerUtil.h99 size_t PageSize(); in RoundUpByPage()
103 size_t Mask = PageSize() - 1; in RoundUpByPage()
109 size_t Mask = PageSize() - 1; in RoundDownByPage()
/freebsd/contrib/llvm-project/compiler-rt/lib/dfsan/
H A Ddfsan_allocator.cpp250 uptr PageSize = GetPageSizeCached(); in dfsan_pvalloc() local
251 if (UNLIKELY(CheckForPvallocOverflow(size, PageSize))) { in dfsan_pvalloc()
259 size = size ? RoundUpTo(size, PageSize) : PageSize; in dfsan_pvalloc()
260 return SetErrnoOnNull(DFsanAllocate(size, PageSize, false /*zeroise*/)); in dfsan_pvalloc()

1234