Home
last modified time | relevance | path

Searched full:allocation (Results 1 – 25 of 1645) sorted by relevance

12345678910>>...66

/llvm-project/clang-tools-extra/test/clang-tidy/checkers/bugprone/
H A Dmultiple-new-in-one-expression.cpp54 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:13: warning: memory allocation may leak if an other allocation in test_function_parameter()
56 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:15: warning: memory allocation may leak if an other allocation in test_function_parameter()
58 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:15: warning: memory allocation may leak if an other allocation in test_function_parameter()
60 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:11: warning: memory allocation may leak if an other allocation in test_function_parameter()
62 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:15: warning: memory allocation may leak if an other allocation in test_function_parameter()
65 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:15: warning: memory allocation may leak if an other allocation in test_function_parameter()
68 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:19: warning: memory allocation may leak if an other allocation in test_function_parameter()
70 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:18: warning: memory allocation may leak if an other allocation in test_function_parameter()
72 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:19: warning: memory allocation may leak if an other allocation in test_function_parameter()
81 …/ CHECK-MESSAGES-ALL: :[[@LINE-1]]:14: warning: memory allocation may leak if an other allocation in test_operator()
[all …]
H A Dunhandled-exception-at-new.cpp34 …// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: missing exception handler for allocation failure at '… in f1()
81 …// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: missing exception handler for allocation failure at '… in f1()
87 …// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: missing exception handler for allocation failure at '… in f1()
111 …// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: missing exception handler for allocation failure at '… in f2()
128 …// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: missing exception handler for allocation failure at '… in f_new_user_defined()
134 …// CHECK-MESSAGES: :[[@LINE-1]]:26: warning: missing exception handler for allocation failure at '… in f_class_specific()
136 …// CHECK-MESSAGES: :[[@LINE-1]]:26: warning: missing exception handler for allocation failure at '… in f_class_specific()
139 …// CHECK-MESSAGES: :[[@LINE-1]]:26: warning: missing exception handler for allocation failure at '… in f_class_specific()
152 …// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: missing exception handler for allocation failure at '… in f_est_noexcept_true()
157 …// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: missing exception handler for allocation failure at '… in f_est_dynamic_none()
[all …]
/llvm-project/clang/test/SemaCXX/
H A Dunavailable_aligned_allocation.cpp3 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -faligned-allocation -faligned-a…
12 // RUN: %clang_cc1 -triple s390x-none-zos -fexceptions -faligned-allocation -faligned-alloc-unavail…
61 // No error here since it is not calling a replaceable allocation function. in testOveraligned()
68 // expected-error-re@-16 {{aligned allocation function of type 'void *(unsigned long, enum std::ali…
69 // expected-note@-17 {{if you supply your own aligned allocation functions}}
71 // expected-note@-19 {{if you supply your own aligned allocation functions}}
73 // expected-error-re@-20 {{aligned allocation function of type 'void *(unsigned long, enum std::ali…
74 // expected-note@-21 {{if you supply your own aligned allocation functions}}
76 // expected-note@-23 {{if you supply your own aligned allocation functions}}
79 // expected-note@-25 {{if you supply your own aligned allocation functions}}
[all …]
/llvm-project/lldb/source/Expression/
H A DIRMemoryMap.cpp113 // adequate space for our allocation. in FindSpace()
156 // default if this is our first allocation. in FindSpace()
161 lldbassert(0 && "The allocation address for expression evaluation must " in FindSpace()
303 IRMemoryMap::Allocation::Allocation(lldb::addr_t process_alloc, in Allocation()
351 Status::FromErrorString("Couldn't malloc: invalid allocation policy"); in Malloc()
467 error = Status::FromErrorString("Couldn't leak: allocation doesn't exist"); in Leak()
471 Allocation &allocation = iter->second; in Free()
473 allocation in Free()
295 IRMemoryMap::Allocation::Allocation(lldb::addr_t process_alloc, Allocation() function in IRMemoryMap::Allocation
466 Allocation &allocation = iter->second; Leak() local
482 Allocation &allocation = iter->second; Free() local
558 Allocation &allocation = iter->second; WriteMemory() local
674 Allocation &allocation = iter->second; ReadMemory() local
815 Allocation &allocation = iter->second; GetMemoryData() local
[all...]
/llvm-project/flang/docs/
H A Dfstack-arrays.md8 `memory-allocation-opt` pass can move large allocations to the heap, but by
14 the stack (like the `memory-allocation-opt` pass in reverse). This approach has
19 the heap to instead generate a stack allocation. The advantage of the second
27 For example, to rewrite the heap allocation in the `array-value-copy` pass with
28 a stack allocation using the first approach would require analysis to ensure
29 that the heap allocation is always freed before the function returns. This is
30 much more complex than never generating a heap allocation (and free) in the
35 general problem of determining heap allocation lifetimes can be simplified in
41 allocation will be kept.
71 The default options for the Memory Allocation transformation ensure that no
[all …]
/llvm-project/clang-tools-extra/docs/clang-tidy/checks/bugprone/
H A Dmultiple-new-in-one-expression.rst7 allocated memory by the first ``new`` may leak if the second allocation fails
11 operator or arguments of a function. Therefore if a first allocation succeeds
13 allocation has failed and free the memory. Even if the order is fixed the result
15 at the time when a second allocation fails. It is best to avoid any expression
17 used to check for allocation errors.
64 // Allocation of 'B'/'A' may fail after memory for 'A'/'B' was allocated.
65 …f(new A, new B); // warning: memory allocation may leak if an other allocation is sequenced after …
70 …// Allocation of 'B'/'A' may fail after memory for 'A'/'B' was allocated but not yet passed to fun…
71 …int X = f1(new A) + f1(new B); // warning: memory allocation may leak if an other allocation is se…
73 // Allocation of 'B' may fail after memory for 'A' was allocated.
[all …]
/llvm-project/lldb/include/lldb/Expression/
H A DIRMemoryMap.h41 0, ///< It is an error for an allocation to have this policy.
42 eAllocationPolicyHostOnly, ///< This allocation was created in the host and
46 eAllocationPolicyMirror, ///< The intent is that this allocation exist both
49 eAllocationPolicyProcessOnly ///< The intent is that this allocation exist
89 struct Allocation { struct
91 m_process_alloc; ///< The (unaligned) base for the remote allocation.
93 m_process_start; ///< The base address of the allocation in the process.
94 size_t m_size; ///< The size of the requested allocation.
103 uint8_t m_alignment; ///< The alignment of the requested allocation.
106 Allocation(lldb::addr_t process_alloc, lldb::addr_t process_start, argument
[all …]
/llvm-project/llvm/test/Transforms/HipStdPar/
H A Dallocation-no-interposition.ll3 …ot be interposed, missing: __hipstdpar_aligned_alloc. Tried to run the allocation interposition pa…
4 ….*}} cannot be interposed, missing: __hipstdpar_free. Tried to run the allocation interposition pa…
5 …}} cannot be interposed, missing: __hipstdpar_calloc. Tried to run the allocation interposition pa…
6 …}} cannot be interposed, missing: __hipstdpar_malloc. Tried to run the allocation interposition pa…
7 …ot be interposed, missing: __hipstdpar_aligned_alloc. Tried to run the allocation interposition pa…
8 …interposed, missing: __hipstdpar_posix_aligned_alloc. Tried to run the allocation interposition pa…
9 …} cannot be interposed, missing: __hipstdpar_realloc. Tried to run the allocation interposition pa…
10 …ot be interposed, missing: __hipstdpar_realloc_array. Tried to run the allocation interposition pa…
11 …not be interposed, missing: __hipstdpar_operator_new. Tried to run the allocation interposition pa…
12 … be interposed, missing: __hipstdpar_operator_delete. Tried to run the allocation interposition pa…
[all …]
/llvm-project/mlir/include/mlir/Dialect/Bufferization/IR/
H A DAllocationOpInterface.td1 //===-- AllocationOpInterface.td - Allocation op interface -*- tablegen -*-===//
9 // Defines the interface with allocation-related methods. It is used by the
25 This interface provides general allocation-related methods that are
26 designed for allocation operations. For example, it offers the ability to
28 with the current allocation operation.
35 current allocation value (which refers to the current Op implementing
36 this interface). The allocation value is a result of the current
46 allocation value (which refers to the current Op implementing this
47 interface). The allocation value is a result of the current operation
64 Builds a stack allocation operation using the provided builder and the
[all …]
/llvm-project/clang/test/Analysis/
H A Dmalloc-overflow.c
/llvm-project/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/
H A Dnew_delete_object.pass.cpp37 std::same_as<int*> decltype(auto) allocation = allocator.template new_object<int>(); in test()
38 std::fill(allocation, allocation + 1, 4); in test()
41 allocator.delete_object(allocation); in test()
44 std::same_as<int*> decltype(auto) allocation = allocator.template new_object<int>(3); in test()
45 assert(*allocation == 3); in test()
46 std::fill(allocation, allocation + 1, 4); in test()
49 allocator.delete_object(allocation); in test()
60 std::same_as<TrackConstruction*> decltype(auto) allocation = in test()
65 allocator.delete_object(allocation); in test()
H A Dallocate_deallocate_object.pass.cpp37 std::same_as<int*> decltype(auto) allocation = allocator.template allocate_object<int>(); in test()
38 std::fill(allocation, allocation + 1, 3); in test()
41 allocator.deallocate_object(allocation); in test()
46 int* allocation = allocator.template allocate_object<int>(3); in test() local
47 std::fill(allocation, allocation + 3, 3); in test()
50 allocator.deallocate_object(allocation, 3); in test()
/llvm-project/llvm/include/llvm/Support/
H A DMemAlloc.h1 //===- MemAlloc.h - Memory allocation functions -----------------*- C++ -*-===//
10 /// This file defines counterparts of C library allocation functions defined in
11 /// the namespace 'std'. The new allocation functions crash on allocation
28 // It is implementation-defined whether allocation occurs if the space in safe_malloc()
33 report_bad_alloc_error("Allocation failed"); in safe_malloc()
42 // It is implementation-defined whether allocation occurs if the space in safe_calloc()
47 report_bad_alloc_error("Allocation failed"); in safe_calloc()
55 // It is implementation-defined whether allocation occurs if the space in safe_realloc()
60 report_bad_alloc_error("Allocation failed"); in safe_realloc()
72 /// compatibility with platforms that, after aligned allocation was added, use
/llvm-project/llvm/include/llvm/Analysis/
H A DMemoryProfileInfo.h23 /// Return the allocation type for a given set of memory profile values.
39 /// Returns the allocation type from an MIB metadata node.
49 /// allocation call, along with their associated allocation types.
50 /// The allocation will be at the root of the trie, which is then used to
52 /// with a single allocation type.
56 // Allocation types for call context sharing the context prefix at this
60 // trie that has an ambiguous allocation type (both Cold and NotCold). It is in CallStackTrieNode()
62 // that we later will only clone Cold contexts, as NotCold is the allocation
93 // the last (root-most) trie node for each allocation contex
[all...]
/llvm-project/llvm/include/llvm/ExecutionEngine/JITLink/
H A DJITLinkMemoryManager.h49 /// Represents a finalized allocation.
54 /// The interpretation of the Address associated with the finalized allocation
56 /// base address of the allocation, or the address of a memory management
57 /// object that tracks the allocation.
67 "Explicitly creating an invalid allocation?"); in FinalizedAlloc()
76 "Cannot overwrite active finalized allocation");
82 "Finalized allocation was not deallocated");
89 /// Returns the address associated with this finalized allocation.
90 /// The allocation is unmodified.
93 /// Returns the address associated with this finalized allocation an
[all...]
/llvm-project/llvm/lib/Analysis/
H A DMemoryProfileInfo.cpp23 // for marking an allocation cold.
28 "lifetime sec) must be under to consider an allocation cold"));
30 // Lower bound on lifetime to mark an allocation cold (in addition to accesses
34 cl::desc("The average lifetime (s) for an allocation to be considered "
38 // density / alloc count) for marking an allocation hot.
43 "allocation to be considered hot"));
52 cl::desc("Report total allocation sizes of hinted allocations")); in getAllocType()
103 // The allocation type is currently the second operand of each memprof in getAllocTypeAttributeString()
104 // MIB metadata. This will need to change as we add additional allocation in getAllocTypeAttributeString()
105 // types that can be applied based on the allocation profil in getAllocTypeAttributeString()
[all...]
/llvm-project/flang/lib/Optimizer/Transforms/
H A DMemoryAllocation.cpp26 #define DEBUG_TYPE "flang-memory-allocation-opt"
31 /// Return `true` if this allocation is to remain on the stack (`fir.alloca`).
32 /// Otherwise the allocation should be moved to the heap (`fir.allocmem`).
50 // If the number of elements exceeds the threshold, move the allocation to in getReturns()
74 LLVM_DEBUG(llvm::dbgs() << "memory allocation opt: replaced " << alloca in keepStackAllocation()
82 LLVM_DEBUG(llvm::dbgs() << "memory allocation opt: add free " << free in keepStackAllocation()
90 /// Currently, implements two conversions from stack to heap allocation. in keepStackAllocation()
91 /// 1. If a stack allocation is an array larger than some threshold value in keepStackAllocation()
92 /// make it a heap allocation. in keepStackAllocation()
93 /// 2. If a stack allocation i in keepStackAllocation()
[all...]
/llvm-project/compiler-rt/lib/gwp_asan/
H A Dcommon.h59 // This struct contains all the metadata recorded about a single allocation made
67 // Maximum number of stack frames to collect on allocation/deallocation. The
72 // Records the given allocation metadata into this struct.
74 // Record that this allocation is now deallocated.
81 // The compressed backtrace to the allocation/deallocation.
90 // The address of this allocation. If zero, the rest of this struct isn't
91 // valid, as the allocation has never occurred.
93 // Represents the actual size of the allocation.
99 // Whether this allocation has been deallocated yet.
102 // In recoverable mode, whether this allocation has had a crash associated
[all …]
H A Dguarded_pool_allocator.h47 // in this allocation pool if the allocator decides to runtime-disable
61 // Initialise the rest of the members of this class. Create the allocation
74 // Execute the callback Cb for every allocation the lies in [Base, Base +
79 // Return whether the allocation should be randomly chosen for sampling.
82 // == 1 means we "should sample this allocation". in shouldSample()
95 // Returns whether the provided pointer is a current sampled allocation that
103 // if the size/alignment makes the allocation too large for this pool to
113 // Returns the size of the allocation at Ptr.
130 // Returns the actual allocation size required to service an allocation with
188 // Reserve a slot for a new guarded allocation. Returns kInvalidSlotID if no
[all …]
/llvm-project/llvm/lib/ExecutionEngine/Orc/TargetProcess/
H A DSimpleExecutorMemoryManager.cpp31 assert(!Allocations.count(MB.base()) && "Duplicate allocation addr"); in allocate()
58 // Get the Allocation for this finalization. in finalize()
65 "allocation " + in finalize()
76 std::pair<void *, Allocation> AllocToDestroy; in finalize()
78 // Get allocation to destroy. in finalize()
83 // Check for missing allocation (effective a double free). in finalize()
87 make_error<StringError>("No allocation entry found " in finalize()
123 "allocation {2:x} -- {3:x}", in finalize()
153 std::vector<std::pair<void *, Allocation>> AllocPairs; in deallocate()
156 // Get allocation to destroy. in deallocate()
[all …]
/llvm-project/mlir/include/mlir/Conversion/MemRefToLLVM/
H A DAllocLikeConversion.h1 //===- AllocLikeConversion.h - Convert allocation ops to LLVM ---*- C++ -*-===//
16 /// Lowering for memory allocation ops.
39 /// Computes the alignment for the given memory allocation op.
60 /// the memory allocation op.
62 /// Aligned_alloc requires the allocation size to be a power of two, and the
63 /// allocation size to be a multiple of the alignment.
72 // consistent with the element type; since the allocation size has to be a in alignedAllocationGetAlignment()
80 /// Allocates a memory buffer using an allocation method that doesn't
87 /// Allocates a memory buffer using an aligned allocation method.
/llvm-project/llvm/unittests/Support/
H A DThreadSafeAllocatorTest.cpp77 // Get the allocation from the allocator first since this requires a lock. in TEST()
81 // First allocation of 1 byte. in TEST()
86 // No allocation yet. in TEST()
89 // Second allocation of 2 bytes. in TEST()
94 C->finishAllocation(); // finish 1st allocation. in TEST()
96 C->waitAllocationStarted(); // wait till 2nd allocation starts. in TEST()
97 // still 1 byte allocated since 2nd allocation is not finished yet. in TEST()
99 C->finishAllocation(); // finish 2nd allocation. in TEST()
/llvm-project/compiler-rt/test/asan/TestCases/Linux/
H A Dprint_memory_profile_test.cpp30 // CHECK-100-10: 2227000 byte(s) ({{.*}}%) in 17 allocation(s)
31 // CHECK-100-10: 672000 byte(s) ({{.*}}%) in 28 allocation(s)
34 // CHECK-100-1: 2227000 byte(s) ({{.*}}%) in 17 allocation(s)
35 // CHECK-100-1-NOT: allocation
38 // CHECK-50-10: 2227000 byte(s) ({{.*}}%) in 17 allocation(s)
39 // CHECK-50-10-NOT: allocation
/llvm-project/clang/docs/analyzer/checkers/
H A Dunix_api_example.c18 void *p = malloc(0); // warn: allocation size of 0 bytes in test()
22 void *p = calloc(0, 42); // warn: allocation size of 0 bytes in test()
27 p = realloc(p, 0); // warn: allocation size of 0 bytes in test()
31 void *p = alloca(0); // warn: allocation size of 0 bytes in test()
35 void *p = valloc(0); // warn: allocation size of 0 bytes in test()
/llvm-project/llvm/test/Transforms/MemProfContextDisambiguation/
H A Doverlapping-contexts.ll3 ;; that partially overlaps with a longer context for a different allocation.
53 ;; D(); // stack id 20 (leads to not cold allocation)
54 ;; M(); // stack id 21 (leads to cold allocation)
55 ;; F(); // stack id 22 (leads to not cold allocation)
56 ;; G(); // stack id 23 (leads to cold allocation)
75 ;; If we don't perform cloning for each allocation separately, we will miss
76 ;; cloning _Z1Cb for the trimmed cold allocation context leading to the
77 ;; allocation at stack id 10.
84 ; REMARKS: call in clone _Z1Ab.memprof.1 marked with memprof allocation attribute cold
89 ; REMARKS: call in clone _Z1Ab marked with memprof allocation attribute notcold
[all …]

12345678910>>...66