/freebsd/contrib/llvm-project/compiler-rt/lib/fuzzer/ |
H A D | FuzzerMutate.cpp | 70 size_t MutationDispatcher::Mutate_Custom(uint8_t *Data, size_t Size, in Mutate_Custom() argument 73 EF->__msan_unpoison(Data, Size); in Mutate_Custom() 76 return EF->LLVMFuzzerCustomMutator(Data, Size, MaxSize, in Mutate_Custom() 80 size_t MutationDispatcher::Mutate_CustomCrossOver(uint8_t *Data, size_t Size, in Mutate_CustomCrossOver() argument 82 if (Size == 0) in Mutate_CustomCrossOver() 92 EF->__msan_unpoison(Data, Size); in Mutate_CustomCrossOver() 99 Data, Size, Other.data(), Other.size(), U.data(), U.size(), in Mutate_CustomCrossOver() 109 size_t MutationDispatcher::Mutate_ShuffleBytes(uint8_t *Data, size_t Size, in Mutate_ShuffleBytes() argument 111 if (Size > MaxSize || Size == 0) return 0; in Mutate_ShuffleBytes() 113 Rand(std::min(Size, (size_t)8)) + 1; // [1,8] and <= Size. in Mutate_ShuffleBytes() [all …]
|
H A D | FuzzerMutate.h | 35 size_t Mutate_Custom(uint8_t *Data, size_t Size, size_t MaxSize); 37 size_t Mutate_CustomCrossOver(uint8_t *Data, size_t Size, size_t MaxSize); 39 size_t Mutate_ShuffleBytes(uint8_t *Data, size_t Size, size_t MaxSize); 41 size_t Mutate_EraseBytes(uint8_t *Data, size_t Size, size_t MaxSize); 43 size_t Mutate_InsertByte(uint8_t *Data, size_t Size, size_t MaxSize); 45 size_t Mutate_InsertRepeatedBytes(uint8_t *Data, size_t Size, size_t MaxSize); 47 size_t Mutate_ChangeByte(uint8_t *Data, size_t Size, size_t MaxSize); 49 size_t Mutate_ChangeBit(uint8_t *Data, size_t Size, size_t MaxSize); 51 size_t Mutate_CopyPart(uint8_t *Data, size_t Size, size_t MaxSize); 54 size_t Mutate_AddWordFromManualDictionary(uint8_t *Data, size_t Size, [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/BinaryFormat/ |
H A D | MsgPackWriter.cpp | 104 size_t Size = s.size(); in write() local 106 if (Size <= FixMax::String) in write() 107 EW.write(static_cast<uint8_t>(FixBits::String | Size)); in write() 108 else if (!Compatible && Size <= UINT8_MAX) { in write() 110 EW.write(static_cast<uint8_t>(Size)); in write() 111 } else if (Size <= UINT16_MAX) { in write() 113 EW.write(static_cast<uint16_t>(Size)); in write() 115 assert(Size <= UINT32_MAX && "String object too long to be encoded"); in write() 117 EW.write(static_cast<uint32_t>(Size)); in write() 126 size_t Size = Buffer.getBufferSize(); in write() local [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/WebAssembly/Disassembler/ |
H A D | WebAssemblyDisassembler.cpp | 47 DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, 51 Expected<bool> onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, 78 static int nextByte(ArrayRef<uint8_t> Bytes, uint64_t &Size) { in nextByte() argument 79 if (Size >= Bytes.size()) in nextByte() 81 auto V = Bytes[Size]; in nextByte() 82 Size++; in nextByte() 86 static bool nextLEB(int64_t &Val, ArrayRef<uint8_t> Bytes, uint64_t &Size, in nextLEB() argument 90 Val = Signed ? decodeSLEB128(Bytes.data() + Size, &N, in nextLEB() 92 : static_cast<int64_t>(decodeULEB128(Bytes.data() + Size, &N, in nextLEB() 97 Size += N; in nextLEB() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/include/orc_rt/ |
H A D | c_api.h | 72 size_t Size; member 80 R->Size = 0; in orc_rt_CWrapperFunctionResultInit() 89 orc_rt_CWrapperFunctionResultAllocate(size_t Size) { in orc_rt_CWrapperFunctionResultAllocate() argument 91 R.Size = Size; in orc_rt_CWrapperFunctionResultAllocate() 94 if (Size > sizeof(R.Data.Value)) in orc_rt_CWrapperFunctionResultAllocate() 95 R.Data.ValuePtr = (char *)malloc(Size); in orc_rt_CWrapperFunctionResultAllocate() 103 orc_rt_CreateCWrapperFunctionResultFromRange(const char *Data, size_t Size) { in orc_rt_CreateCWrapperFunctionResultFromRange() argument 105 R.Size = Size; in orc_rt_CreateCWrapperFunctionResultFromRange() 106 if (R.Size > sizeof(R.Data.Value)) { in orc_rt_CreateCWrapperFunctionResultFromRange() 107 char *Tmp = (char *)malloc(Size); in orc_rt_CreateCWrapperFunctionResultFromRange() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/gwp_asan/platform_specific/ |
H A D | guarded_pool_allocator_posix.cpp | 29 void MaybeSetMappingName(void *Mapping, size_t Size, const char *Name) { in MaybeSetMappingName() argument 31 prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, Mapping, Size, Name); in MaybeSetMappingName() 45 void *GuardedPoolAllocator::map(size_t Size, const char *Name) const { in map() argument 46 assert((Size % State.PageSize) == 0); in map() 47 void *Ptr = mmap(nullptr, Size, PROT_READ | PROT_WRITE, in map() 50 MaybeSetMappingName(Ptr, Size, Name); in map() 54 void GuardedPoolAllocator::unmap(void *Ptr, size_t Size) const { in unmap() 56 assert((Size % State.PageSize) == 0); in unmap() 57 check(munmap(Ptr, Size) == 0, in unmap() 61 void *GuardedPoolAllocator::reserveGuardedPool(size_t Size) { in reserveGuardedPool() argument [all …]
|
H A D | guarded_pool_allocator_fuchsia.cpp | 23 void *GuardedPoolAllocator::map(size_t Size, const char *Name) const { in map() argument 24 assert((Size % State.PageSize) == 0); in map() 26 zx_status_t Status = _zx_vmo_create(Size, 0, &Vmo); in map() 32 0, Vmo, 0, Size, &Addr); in map() 38 void GuardedPoolAllocator::unmap(void *Ptr, size_t Size) const { in unmap() 40 assert((Size % State.PageSize) == 0); in unmap() 42 reinterpret_cast<zx_vaddr_t>(Ptr), Size); in unmap() 46 void *GuardedPoolAllocator::reserveGuardedPool(size_t Size) { in reserveGuardedPool() argument 47 assert((Size % State.PageSize) == 0); in reserveGuardedPool() 52 Size, &GuardedPagePoolPlatformData.Vmar, &Addr); in reserveGuardedPool() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/scudo/standalone/ |
H A D | mem_map.cpp | 15 bool MemMapDefault::mapImpl(uptr Addr, uptr Size, const char *Name, in mapImpl() argument 18 ::scudo::map(reinterpret_cast<void *>(Addr), Size, Name, Flags, &Data); in mapImpl() 23 Capacity = Size; in mapImpl() 27 void MemMapDefault::unmapImpl(uptr Addr, uptr Size) { in unmapImpl() argument 28 if (Size == Capacity) { in unmapImpl() 32 Base = Addr + Size; in unmapImpl() 35 Capacity -= Size; in unmapImpl() 38 ::scudo::unmap(reinterpret_cast<void *>(Addr), Size, UNMAP_ALL, &Data); in unmapImpl() 41 bool MemMapDefault::remapImpl(uptr Addr, uptr Size, const char *Name, in remapImpl() argument 44 ::scudo::map(reinterpret_cast<void *>(Addr), Size, Name, Flags, &Data); in remapImpl() [all …]
|
H A D | mem_map_base.h | 26 bool map(uptr Addr, uptr Size, const char *Name, uptr Flags = 0) { 28 return invokeImpl(&Derived::mapImpl, Addr, Size, Name, Flags); 33 void unmap(uptr Addr, uptr Size) { in unmap() argument 35 DCHECK((Addr == getBase()) || (Addr + Size == getBase() + getCapacity())); in unmap() 36 invokeImpl(&Derived::unmapImpl, Addr, Size); in unmap() 42 bool remap(uptr Addr, uptr Size, const char *Name, uptr Flags = 0) { 44 DCHECK((Addr >= getBase()) && (Addr + Size <= getBase() + getCapacity())); 45 return invokeImpl(&Derived::remapImpl, Addr, Size, Name, Flags); 50 void setMemoryPermission(uptr Addr, uptr Size, uptr Flags) { in setMemoryPermission() argument 52 DCHECK((Addr >= getBase()) && (Addr + Size <= getBase() + getCapacity())); in setMemoryPermission() [all …]
|
H A D | mem_map_fuchsia.cpp | 24 uptr Size) { in dieOnError() argument 27 Size >> 10, _zx_status_get_string(Status)); in dieOnError() 105 bool MemMapFuchsia::mapImpl(UNUSED uptr Addr, uptr Size, const char *Name, in mapImpl() argument 112 zx_status_t Status = _zx_vmo_create(Size, 0, &Vmo); in mapImpl() 116 dieOnError(Status, "zx_vmo_create", Size); in mapImpl() 127 _zx_vmar_map(_zx_vmar_root_self(), MapFlags, 0, Vmo, 0, Size, &MapAddr); in mapImpl() 137 dieOnError(Status, "zx_vmar_map", Size); in mapImpl() 142 Size, nullptr, 0); in mapImpl() 147 WindowSize = Size; in mapImpl() 151 void MemMapFuchsia::unmapImpl(uptr Addr, uptr Size) { in unmapImpl() argument [all …]
|
H A D | vector.h | 27 DCHECK_LT(I, Size); 31 DCHECK_LT(I, Size); 35 DCHECK_LE(Size, capacity()); in push_back() 36 if (Size == capacity()) { in push_back() 37 const uptr NewCapacity = roundUpPowerOfTwo(Size + 1); in push_back() 42 memcpy(&Data[Size++], &Element, sizeof(T)); in push_back() 45 DCHECK_GT(Size, 0); in back() 46 return Data[Size - 1]; in back() 49 DCHECK_GT(Size, 0); in pop_back() 50 Size--; in pop_back() [all …]
|
H A D | quarantine.h | 24 uptr Size; member 28 void init(void *Ptr, uptr Size) { in init() 31 this->Size = Size + sizeof(QuarantineBatch); // Account for the Batch Size. in init() 35 uptr getQuarantinedSize() const { return Size - sizeof(QuarantineBatch); } in getQuarantinedSize() 37 void push_back(void *Ptr, uptr Size) { in push_back() 40 this->Size += Size; in push_back() 49 DCHECK_GE(Size, sizeof(QuarantineBatch)); in merge() 54 Size += From->getQuarantinedSize(); in merge() 57 From->Size = sizeof(QuarantineBatch); in merge() 68 void init() { DCHECK_EQ(atomic_load_relaxed(&Size), 0U); } in init() [all …]
|
H A D | fuchsia.cpp | 36 uptr Size) { in dieOnError() argument 39 Size >> 10, zx_status_get_string(Status)); in dieOnError() 44 static void *allocateVmar(uptr Size, MapPlatformData *Data, bool AllowNoMem) { in allocateVmar() argument 52 Size, &Data->Vmar, &Data->VmarBase); in allocateVmar() 55 dieOnError(Status, "zx_vmar_allocate", Size); in allocateVmar() 61 void *map(void *Addr, uptr Size, const char *Name, uptr Flags, in map() argument 63 DCHECK_EQ(Size % getPageSizeCached(), 0); in map() 68 return allocateVmar(Size, Data, AllowNoMem); in map() 83 Status = _zx_vmo_set_size(Vmo, VmoSize + Size); in map() 86 dieOnError(Status, "zx_vmo_set_size", VmoSize + Size); in map() [all …]
|
H A D | wrappers_c_checks.h | 33 inline bool checkAlignedAllocAlignmentAndSize(uptr Alignment, uptr Size) { in checkAlignedAllocAlignmentAndSize() argument 34 return !isPowerOfTwo(Alignment) || !isAligned(Size, Alignment); in checkAlignedAllocAlignmentAndSize() 46 inline bool checkForCallocOverflow(uptr Size, uptr N, uptr *Product) { in checkForCallocOverflow() argument 48 return __builtin_umull_overflow(Size, N, in checkForCallocOverflow() 52 return __builtin_umul_overflow(Size, N, in checkForCallocOverflow() 55 *Product = Size * N; in checkForCallocOverflow() 56 if (!Size) in checkForCallocOverflow() 58 return (*Product / Size) != N; in checkForCallocOverflow() 64 inline bool checkForPvallocOverflow(uptr Size, uptr PageSize) { in checkForPvallocOverflow() argument 65 return roundUp(Size, PageSize) < Size; in checkForPvallocOverflow()
|
H A D | size_class_map.h | 18 inline uptr scaledLog2(uptr Size, uptr ZeroLog, uptr LogBits) { in scaledLog2() argument 19 const uptr L = getMostSignificantSetBitIndex(Size); in scaledLog2() 20 const uptr LBits = (Size >> (L - LogBits)) - (1 << LogBits); in scaledLog2() 26 static u16 getMaxCachedHint(uptr Size) { in getMaxCachedHint() 27 DCHECK_NE(Size, 0); in getMaxCachedHint() 31 N = static_cast<u32>((1UL << Config::MaxBytesCachedLog) / Size); in getMaxCachedHint() 33 N = (1U << Config::MaxBytesCachedLog) / static_cast<u32>(Size); in getMaxCachedHint() 95 static uptr getClassIdBySize(uptr Size) { in getClassIdBySize() argument 96 if (Size <= Config::SizeDelta + (1 << Config::MinSizeLog)) in getClassIdBySize() 98 Size in getClassIdBySize() 105 getMaxCachedHint(uptr Size) getMaxCachedHint() argument 208 getClassIdBySize(uptr Size) getClassIdBySize() argument 218 getMaxCachedHint(uptr Size) getMaxCachedHint() argument [all...] |
/freebsd/contrib/llvm-project/compiler-rt/lib/xray/ |
H A D | xray_segmented_array.h | 83 uint64_t Size = 0; variable 89 Size(S) {} in Iterator() 98 if (++Offset % ElementsPerSegment || Offset == Size) 104 DCHECK_NE(Offset, Size); 117 if (PreviousOffset != Size && PreviousOffset % ElementsPerSegment == 0) { 170 uint64_t Size; variable 300 Size(0) {} in Array() 306 Size(0) {} in Array() 315 Size(O.Size) { in Array() 319 O.Size = 0; in Array() [all …]
|
/freebsd/sys/contrib/dev/acpica/components/utilities/ |
H A D | uttrack.c | 181 ACPI_SIZE Size, 249 ACPI_SIZE Size, in AcpiUtAllocateAndTrack() argument 260 if (!Size) in AcpiUtAllocateAndTrack() 264 Size = 1; in AcpiUtAllocateAndTrack() 267 Allocation = AcpiOsAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER)); in AcpiUtAllocateAndTrack() 273 "Could not allocate size %u", (UINT32) Size)); in AcpiUtAllocateAndTrack() 279 Allocation, Size, ACPI_MEM_MALLOC, Component, Module, Line); in AcpiUtAllocateAndTrack() 287 AcpiGbl_GlobalList->TotalSize += (UINT32) Size; in AcpiUtAllocateAndTrack() 288 AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size; in AcpiUtAllocateAndTrack() 318 ACPI_SIZE Size, in AcpiUtAllocateZeroedAndTrack() argument [all …]
|
/freebsd/contrib/llvm-project/clang/include/clang/Analysis/Analyses/ |
H A D | ThreadSafetyUtil.h | 88 : Data(Dat), Size(Sz), Capacity(Cp) {} in Data() 94 : Data(A.Data), Size(A.Size), Capacity(A.Capacity) { in SimpleArray() 96 A.Size = 0; in SimpleArray() 103 Size = RHS.Size; 107 RHS.Size = RHS.Capacity = 0; 119 memcpy(Data, Odata, sizeof(T) * Size); in reserve() 126 else if (Size + N < Capacity) in reserveCheck() 127 reserve(u_max(Size + N, Capacity * 2), A); in reserveCheck() 135 size_t size() const { return Size; } in size() 139 assert(i < Size && "Array index out of bounds."); [all …]
|
/freebsd/contrib/llvm-project/clang/lib/AST/Interp/ |
H A D | InterpStack.cpp | 37 void *InterpStack::grow(size_t Size) { in grow() argument 38 assert(Size < ChunkSize - sizeof(StackChunk) && "Object too large"); in grow() 40 if (!Chunk || sizeof(StackChunk) + Chunk->size() + Size > ChunkSize) { in grow() 52 Chunk->End += Size; in grow() 53 StackSize += Size; in grow() 57 void *InterpStack::peekData(size_t Size) const { in peekData() 61 while (Size > Ptr->size()) { in peekData() 62 Size -= Ptr->size(); in peekData() 67 return reinterpret_cast<void *>(Ptr->End - Size); in peekData() 70 void InterpStack::shrink(size_t Size) { in shrink() argument [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | ASanStackFrameLayout.cpp | 40 static uint64_t VarAndRedzoneSize(uint64_t Size, uint64_t Granularity, in VarAndRedzoneSize() argument 43 if (Size <= 4) Res = 16; in VarAndRedzoneSize() 44 else if (Size <= 16) Res = 32; in VarAndRedzoneSize() 45 else if (Size <= 128) Res = Size + 32; in VarAndRedzoneSize() 46 else if (Size <= 512) Res = Size + 64; in VarAndRedzoneSize() 47 else if (Size <= 4096) Res = Size + 128; in VarAndRedzoneSize() 48 else Res = Size + 256; in VarAndRedzoneSize() 76 uint64_t Size = Vars[i].Size; in ComputeASanStackFrameLayout() local 80 assert(Size > 0); in ComputeASanStackFrameLayout() 84 VarAndRedzoneSize(Size, Granularity, NextAlignment); in ComputeASanStackFrameLayout() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/AVR/MCTargetDesc/ |
H A D | AVRAsmBackend.cpp | 78 static void adjustBranch(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in adjustBranch() argument 82 unsigned_width(Size + 1, Value, std::string("branch target"), Fixup, Ctx); in adjustBranch() 89 static void adjustRelativeBranch(unsigned Size, const MCFixup &Fixup, in adjustRelativeBranch() argument 96 signed_width(Size + 1, Value, std::string("branch target"), Fixup, Ctx); in adjustRelativeBranch() 108 static void fixup_call(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup_call() argument 110 adjustBranch(Size, Fixup, Value, Ctx); in fixup_call() 124 static void fixup_7_pcrel(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup_7_pcrel() argument 126 adjustRelativeBranch(Size, Fixup, Value, Ctx); in fixup_7_pcrel() 138 static void fixup_13_pcrel(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup_13_pcrel() argument 140 adjustRelativeBranch(Size, Fixup, Value, Ctx); in fixup_13_pcrel() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/orc/ |
H A D | simple_packed_serialization.h | 58 bool write(const char *Data, size_t Size) { in write() argument 59 if (Size > Remaining) in write() 61 memcpy(Buffer, Data, Size); in write() 62 Buffer += Size; in write() 63 Remaining -= Size; in write() 78 bool read(char *Data, size_t Size) { in read() argument 79 if (Size > Remaining) in read() 81 memcpy(Data, Buffer, Size); in read() 82 Buffer += Size; in read() 83 Remaining -= Size; in read() 88 skip(size_t Size) skip() argument 270 reserve(std::string & S,uint64_t Size) reserve() argument 292 reserve(std::vector<T> & V,uint64_t Size) reserve() argument 318 reserve(std::unordered_map<K,V> & M,uint64_t Size) reserve() argument 335 size_t Size = SPSArgList<uint64_t>::size(static_cast<uint64_t>(S.size())); size() local 352 uint64_t Size; deserialize() local 380 uint64_t Size; deserialize() local 413 size_t Size = SPSArgList<bool>::size(!!Value); size() local 459 uint64_t Size; deserialize() local 541 size_t Size = SPSArgList<bool>::size(BSE.HasError); size() local 576 size_t Size = SPSArgList<bool>::size(BSE.HasValue); size() local [all...] |
/freebsd/contrib/llvm-project/llvm/lib/MC/ |
H A D | StringTableBuilder.cpp | 35 Size = 0; in initSize() 39 Size = 2; in initSize() 46 Size = 1; in initSize() 51 Size = 4; in initSize() 81 support::endian::write32le(Buf, Size); in write() 83 support::endian::write32be(Buf, Size); in write() 154 size_t Pos = Size - S.size() - (K != RAW); in finalizeStringTable() 161 Size = alignTo(Size, Alignment); in finalizeStringTable() 162 P->second = Size; in finalizeStringTable() [all...] |
/freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/ |
H A D | RuntimeDyldChecker.h | 88 : ContentPtr(Content.data()), Size(Content.size()), in MemoryRegionInfo() 92 MemoryRegionInfo(uint64_t Size, JITTargetAddress TargetAddress) in isZeroFill() 93 : Size(Size), TargetAddress(TargetAddress) {} in isZeroFill() 97 assert(Size && "setContent/setZeroFill must be called first"); in setContent() 103 assert(!ContentPtr && !Size && "Content/zero-fill already set"); 105 Size = Content.size(); in setZeroFill() 109 void setZeroFill(uint64_t Size) { 110 assert(!ContentPtr && !this->Size && "Content/zero-fill already set"); in getContent() 111 this->Size in getContent() 87 MemoryRegionInfo(uint64_t Size,JITTargetAddress TargetAddress) MemoryRegionInfo() argument 104 setZeroFill(uint64_t Size) setZeroFill() argument 132 uint64_t Size = 0; global() variable [all...] |
/freebsd/contrib/llvm-project/llvm/lib/Support/ |
H A D | FormattedStream.cpp | 26 void formatted_raw_ostream::UpdatePosition(const char *Ptr, size_t Size) { in UpdatePosition() argument 58 if (Size < BytesFromBuffer) { in UpdatePosition() 61 PartialUTF8Char.append(StringRef(Ptr, Size)); in UpdatePosition() 71 Size -= BytesFromBuffer; in UpdatePosition() 77 for (const char *End = Ptr + Size; Ptr < End; Ptr += NumBytes) { in UpdatePosition() 96 void formatted_raw_ostream::ComputePosition(const char *Ptr, size_t Size) { in ComputePosition() argument 103 if (Ptr <= Scanned && Scanned <= Ptr + Size) in ComputePosition() 106 UpdatePosition(Scanned, Size - (Scanned - Ptr)); in ComputePosition() 108 UpdatePosition(Ptr, Size); in ComputePosition() 111 Scanned = Ptr + Size; 124 write_impl(const char * Ptr,size_t Size) write_impl() argument [all...] |