| /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 …]
|
| H A D | FuzzerDictionary.h | 35 Size = static_cast<uint8_t>(S); in Set() 39 return Size == w.Size && 0 == memcmp(Data, w.Data, Size); 44 uint8_t size() const { return Size; } in size() 47 uint8_t Size = 0; 97 const DictionaryEntry *end() const { return begin() + Size; } in end() 99 assert(Idx < Size); 103 if (Size < kMaxDictSize) in push_back() 104 this->DE[Size++] = DE; in push_back() 106 void clear() { Size = 0; } in clear() 107 bool empty() const { return Size == 0; } in empty() [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 | 48 DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, 52 Expected<bool> onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, 79 static int nextByte(ArrayRef<uint8_t> Bytes, uint64_t &Size) { in nextByte() argument 80 if (Size >= Bytes.size()) in nextByte() 82 auto V = Bytes[Size]; in nextByte() 83 Size++; in nextByte() 87 static bool nextLEB(int64_t &Val, ArrayRef<uint8_t> Bytes, uint64_t &Size, in nextLEB() argument 91 Val = Signed ? decodeSLEB128(Bytes.data() + Size, &N, in nextLEB() 93 : static_cast<int64_t>(decodeULEB128(Bytes.data() + Size, &N, in nextLEB() 98 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_WrapperFunctionResultInit() 89 orc_rt_WrapperFunctionResultAllocate(size_t Size) { in orc_rt_WrapperFunctionResultAllocate() argument 91 R.Size = Size; in orc_rt_WrapperFunctionResultAllocate() 94 if (Size > sizeof(R.Data.Value)) in orc_rt_WrapperFunctionResultAllocate() 95 R.Data.ValuePtr = (char *)malloc(Size); in orc_rt_WrapperFunctionResultAllocate() 103 orc_rt_CreateWrapperFunctionResultFromRange(const char *Data, size_t Size) { in orc_rt_CreateWrapperFunctionResultFromRange() argument 105 R.Size = Size; in orc_rt_CreateWrapperFunctionResultFromRange() 106 if (R.Size > sizeof(R.Data.Value)) { in orc_rt_CreateWrapperFunctionResultFromRange() 107 char *Tmp = (char *)malloc(Size); in orc_rt_CreateWrapperFunctionResultFromRange() [all …]
|
| /freebsd/contrib/llvm-project/compiler-rt/lib/gwp_asan/platform_specific/ |
| H A D | guarded_pool_allocator_posix.cpp | 30 void MaybeSetMappingName(void *Mapping, size_t Size, const char *Name) { in MaybeSetMappingName() argument 32 prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, Mapping, Size, Name); in MaybeSetMappingName() 46 void *GuardedPoolAllocator::map(size_t Size, const char *Name) const { in map() argument 47 assert((Size % State.PageSize) == 0); in map() 48 void *Ptr = mmap(nullptr, Size, PROT_READ | PROT_WRITE, in map() 52 MaybeSetMappingName(Ptr, Size, Name); in map() 56 void GuardedPoolAllocator::unmap(void *Ptr, size_t Size) const { in unmap() 58 assert((Size % State.PageSize) == 0); in unmap() 59 checkWithErrorCode(munmap(Ptr, Size) == 0, in unmap() 63 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() 44 bool remap(uptr Addr, uptr Size, const char *Name, uptr Flags = 0) { 46 DCHECK((Addr >= getBase()) && (Addr + Size <= getBase() + getCapacity())); 47 return invokeImpl(&Derived::remapImpl, Addr, Size, Name, Flags); 52 void setMemoryPermission(uptr Addr, uptr Size, uptr Flags) { in setMemoryPermission() argument 54 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/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/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/contrib/llvm-project/llvm/lib/Target/AVR/MCTargetDesc/ |
| H A D | AVRAsmBackend.cpp | 49 static void adjustBranch(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in adjustBranch() argument 53 unsigned_width(Size + 1, Value, std::string("branch target"), Fixup, Ctx); in adjustBranch() 60 static bool adjustRelativeBranch(unsigned Size, const MCFixup &Fixup, in adjustRelativeBranch() argument 67 Size += 1; in adjustRelativeBranch() 71 if (!isIntN(Size, Value) && STI->hasFeature(AVR::FeatureWrappingRjmp)) { in adjustRelativeBranch() 78 if (isIntN(Size, WrappedValue)) { in adjustRelativeBranch() 83 if (!isIntN(Size, Value)) { in adjustRelativeBranch() 99 static void fixup_call(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup_call() argument 101 adjustBranch(Size, Fixup, Value, Ctx); in fixup_call() 115 static void fixup_7_pcrel(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup_7_pcrel() 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/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/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() 103 void formatted_raw_ostream::ComputePosition(const char *Ptr, size_t Size) { in ComputePosition() argument 110 if (Ptr <= Scanned && Scanned <= Ptr + Size) in ComputePosition() 113 UpdatePosition(Scanned, Size - (Scanned - Ptr)); in ComputePosition() 115 UpdatePosition(Ptr, Size); in ComputePosition() 118 Scanned = Ptr + Size; in ComputePosition() [all …]
|
| /freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/Shared/ |
| H A D | SimplePackedSerialization.h | 59 bool write(const char *Data, size_t Size) { in write() argument 61 if (Size > Remaining) in write() 63 memcpy(Buffer, Data, Size); in write() 64 Buffer += Size; in write() 65 Remaining -= Size; in write() 80 bool read(char *Data, size_t Size) { in read() argument 81 if (Size > Remaining) in read() 83 memcpy(Data, Buffer, Size); in read() 84 Buffer += Size; in read() 85 Remaining -= Size; in read() [all …]
|
| /freebsd/contrib/llvm-project/llvm/include/llvm/ADT/ |
| H A D | CachedHashString.h | 31 uint32_t Size; variable 40 : P(S.data()), Size(S.size()), Hash(Hash) { in CachedHashStringRef() 44 StringRef val() const { return StringRef(P, Size); } in val() 46 uint32_t size() const { return Size; } in size() 76 uint32_t Size; 91 : P(EmptyOrTombstonePtr), Size(0), Hash(0) { 105 : P(new char[S.size()]), Size(S.size()), Hash(Hash) { 112 : Size(Other.Size), Hash(Other.Hash) { 116 P = new char[Size]; 117 memcpy(P, Other.P, Size); [all …]
|
| /freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
| H A D | sanitizer_procmaps_bsd.cpp | 37 uptr Size = Len; in GetMemoryProfile() local 38 InfoProc = (struct kinfo_proc *)MmapOrDie(Size, "GetMemoryProfile()"); in GetMemoryProfile() 43 UnmapOrDie(InfoProc, Size, true); in GetMemoryProfile() 49 uptr Size = Len; 51 getpid(), (int)Size, 1}; 52 InfoProc = (struct kinfo_proc2 *)MmapOrDie(Size, "GetMemoryProfile()"); 57 UnmapOrDie(InfoProc, Size, true); 79 uptr Size = 0; in ReadProcMaps() local 80 int Err = internal_sysctl(Mib, ARRAY_SIZE(Mib), NULL, &Size, NULL, 0); in ReadProcMaps() 82 CHECK_GT(Size, 0); in ReadProcMaps() [all …]
|