Home
last modified time | relevance | path

Searched refs:malloc (Results 1 – 25 of 1049) sorted by relevance

12345678910>>...42

/llvm-project-15.0.7/lldb/test/Shell/Expr/Inputs/
H A Dir-memory-map-mix-malloc-free1 L1 = malloc 32 2
3 L2 = malloc 3 4
4 L3 = malloc 3 128
7 L4 = malloc 2 16
9 L5 = malloc 4097 4
11 L6 = malloc 2 2
12 L7 = malloc 3 2
13 L8 = malloc 32 16
18 L10 = malloc 33 4
21 L12 = malloc 5 16
[all …]
H A Dir-memory-map-basic1 L1 = malloc 0 1
2 L2 = malloc 1 1
4 L3 = malloc 2 1
5 L4 = malloc 2 2
6 L5 = malloc 2 4
8 L6 = malloc 3 1
9 L7 = malloc 3 2
10 L8 = malloc 3 4
12 L9 = malloc 128 1
13 L10 = malloc 128 2
[all …]
H A Dir-memory-map-overlap11 L1 = malloc 8 16
2 L2 = malloc 16 8
3 L3 = malloc 64 32
4 L4 = malloc 1 8
5 L5 = malloc 64 32
6 L6 = malloc 64 8
7 L7 = malloc 1024 32
8 L8 = malloc 1 16
9 L9 = malloc 8 16
10 L10 = malloc 1024 16
/llvm-project-15.0.7/clang/test/Analysis/
H A Dmalloc.c30 void *malloc(size_t);
52 int *p = malloc(12); in f1()
57 int *p = malloc(12); in f2()
63 int *p = malloc(12); in f2_realloc_0()
69 int *p = malloc(12); in f2_realloc_1()
95 int *q = malloc(12); in realloctest1()
385 p = malloc(12); in f3()
790 p = malloc(12); in mallocEscapeMalloc()
795 p = malloc(12); in mallocMalloc()
802 p = malloc(12); in mallocFreeMalloc()
[all …]
H A Dmalloc-annotations.c9 void *malloc(size_t);
34 int *p = malloc(12); in f1()
39 int *p = malloc(12); in f2()
45 int *p = malloc(12); in f2_realloc_0()
51 int *p = malloc(12); in f2_realloc_1()
158 p = malloc(12); in f3()
167 p_f4 = malloc(12); in f4()
172 int *q = malloc(12); in f5()
178 int *p = malloc(12); in f6()
186 int *p = malloc(12); in f6_realloc()
[all …]
H A Dmalloc-overflow.c5 extern void * malloc(size_t);
9 …return malloc(n * sizeof(int)); // expected-warning {{the computation of the size of the memory a… in f1()
14 …return malloc(sizeof(int) * n); // // expected-warning {{the computation of the size of the memory… in f2()
19 return malloc(4 * sizeof(int)); // no-warning in f3()
29 …return malloc(s->n * sizeof(int)); // expected-warning {{the computation of the size of the memory… in f4()
43 extern void * malloc (size_t);
49 return malloc(n * sizeof(int)); // no-warning in f7()
55 return malloc(n * sizeof(int)); // no-warning in f8()
90 int * x = malloc(n * sizeof(int)); // no-warning in f12()
105 return malloc(s->n * sizeof(int)); // no-warning in f13()
[all …]
H A Dmalloc-plist.c6 void *malloc(size_t);
12 int *p = malloc(12); in diagnosticTest()
21 A = malloc(2*sizeof(int*)); in myArrayAllocation()
26 char * buf = malloc(100); in reallocDiagnostics()
37 void *x = malloc(100); in wrapper()
55 *x = malloc(100); in my_malloc_and_free()
83 return (char*)malloc(12); in malloc_wrapper_ret()
109 p = (int*)malloc(12); in LeakedSymbol()
183 return (char*)malloc(12); in function_with_leak7()
192 int *p = malloc(12); in my_malloc()
[all …]
H A Dmalloc-sizeof.c5 void *malloc(size_t size);
14 int *ip1 = malloc(sizeof(1)); in foo()
15 int *ip2 = malloc(4 * sizeof(int)); in foo()
19 char *cp3 = malloc(5 * sizeof(char) + 2); // no warning in foo()
20 unsigned char *buf = malloc(readSize + sizeof(unsignedInt)); // no warning in foo()
30 void **vpp1 = (void **)malloc(sizeof(struct A*)); // no warning in foo()
35 const char **x = (const char **)malloc(1 * sizeof(char *)); // no-warning in ignore_const()
43 int *table = malloc(sizeof sTable); in mallocArraySize()
44 int *table1 = malloc(sizeof nestedTable); in mallocArraySize()
45 int (*table2)[2] = malloc(sizeof nestedTable); in mallocArraySize()
[all …]
H A Dmalloc.mm96 void *data = malloc(42);
102 void *data = malloc(42);
166 void *key = malloc(12);
167 void *val = malloc(12);
174 void *bytes = malloc(10);
213 void *newItem = malloc(4); function
251 void *l = malloc(12);
257 void *l = malloc(12);
264 void* p1 = malloc (1024);
269 void* p2 = malloc (1024);
[all …]
H A DMalloc+MismatchedDeallocator+NewDelete.cpp10 int *p = (int *)malloc(sizeof(int)); in testMallocDoubleFree()
16 int *p = (int *)malloc(sizeof(int)); in testMallocLeak()
20 int *p = (int *)malloc(sizeof(int)); in testMallocUseAfterFree()
31 int *p = (int *)malloc(sizeof(int)); in testMallocOffsetFree()
39 int *x = (int *)malloc(sizeof(int)); in testMismatchedDeallocator()
83 int *p = (int*)malloc(sizeof(int)*4); in testMismatchedChangePtrThroughCall()
89 int *p = (int*)malloc(sizeof(int)*4); in testMismatchedChangePointeeThroughCall()
95 int *p = (int*)malloc(sizeof(int)*4); in testShouldReportDoubleFreeNotMismatched()
H A Dcoverage.c5 void *malloc(size_t);
35 char *m = (char*)malloc(12); in coverage1()
41 char *m = (char*)malloc(12); in coverage2()
48 char *m = (char*)malloc(12); in coverage3()
54 char *m = (char*)malloc(12); in coverage4()
61 char *m = (char*)malloc(12); // no-warning in coverage5()
68 char *m = (char*)malloc(12); in coverage6()
80 char *m = (char*)malloc(12); in coverage8()
H A Dmalloc.cpp34 void *malloc(size_t);
41 malloc(4); in checkThatMallocCheckerIsRunning()
50 return malloc(10); in aFunction()
59 char *x = (char*)malloc(12); in r11160612_3()
65 char *x = (char*)malloc(12); in r11160612_no_callback()
75 char *x = (char*)malloc(12); in r11160612_3()
94 v.push_back(malloc(4)); in testDestructors()
103 result.a = malloc(4); in get()
161 char* funcname = (char*)malloc(funcnamesize); in test_cxa_demangle()
177 name = static_cast<char *>(malloc(10)); in getName()
H A Dnew.cpp8 extern "C" void *malloc(size_t);
32 int *x = (int *)malloc(sizeof(int)); in testPlacementNew()
56 int *x = (int *)malloc(sizeof(int)); in testCustomNewMalloc()
91 new (w) PtrWrapper(static_cast<int *>(malloc(4))); // no-warning in testNewInvalidationPlacement()
96 return new (int *)(static_cast<int *>(malloc(4))); // no-warning in testNewInvalidationScalar()
101 new (p) (int *)(static_cast<int *>(malloc(4))); // no-warning in testNewInvalidationScalarPlacement()
134 int *x = (int *)malloc(sizeof(int)); in testDeleteMallocked()
140 int *p = (int *)malloc(sizeof(int)); in testDeleteOpAfterFree()
146 int *p = (int *)malloc(sizeof(int)); in testDeleteAfterFree()
152 int *p = (int *)malloc(sizeof(int)); in testStandardPlacementNewAfterFree()
[all …]
H A DMismatchedDeallocator-checker-test.mm8 void *malloc(size_t); function
21 //--------------- test malloc family
23 int *p = (int *)malloc(sizeof(int));
28 int *p = (int *)malloc(8);
49 int *p = (int *)malloc(sizeof(int));
54 int *p = (int *)malloc(sizeof(int));
59 int *p = (int *)malloc(sizeof(int));
152 int *p = (int *)malloc(sizeof(int));
158 int *p = (int *)malloc(sizeof(int));
164 int *p = (int *)malloc(sizeof(int));
[all …]
H A Dmalloc-overflow2.c5 extern void *malloc(size_t);
8 void *malloc(unsigned long s);
19 …t->table = (unsigned *)malloc(sizeof(unsigned) * t->nentry); // expected-warning {{the computation… in table_build()
23 int *p = malloc(sizeof(int) * n); // no-warning in table_build()
31 t->table = (unsigned *)malloc(sizeof(unsigned) * t->nentry); // no-warning in table_build_1()
36 return malloc(n * 0 * sizeof(int)); in f()
H A Dmax-nodes-suppress-on-sink.c12 void *malloc(size_t);
21 void *p = malloc(1); // no-warning (wherever the leak warning may occur here) in test_single_cfg_block_sink()
38 void *p = malloc(1); // no-warning in test_more_complex_control_flow_before_sink()
52 void *p = malloc(1); // no-warning in test_loop_before_sink()
64 void *p = malloc(1); // expected-warning@+2{{Potential leak of memory}} in test_loop_with_sink()
76 void *p = malloc(1); // no-warning in test_unreachable_successor_blocks()
/llvm-project-15.0.7/clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/
H A Downing-memory-legacy-functions.cpp16 void *malloc(size_t ByteCount);
40 using ::malloc;
61 void *dataFactory1() { return std::malloc(100); } in dataFactory1()
69 int *IntArray1 = (int *)std::malloc(ByteCount); in test_resource_creators()
73 void *IntArray3 = std::malloc(ByteCount); in test_resource_creators()
76 int *IntArray4 = (int *)::malloc(ByteCount); in test_resource_creators()
80 void *IntArray6 = ::malloc(ByteCount); in test_resource_creators()
89 nonOwningCall((int *)malloc(ByteCount), 25); in test_resource_creators()
91 nonOwningCall((int *)::malloc(ByteCount), 25); in test_resource_creators()
97 testNonCasted(malloc(ByteCount)); in test_resource_creators()
[all …]
/llvm-project-15.0.7/clang/test/Sema/
H A Dattr-malloc.c7 void * malloc(size_t) __attribute((malloc));
9 int no_vars __attribute((malloc)); // expected-warning {{attribute only applies to functions}}
11 void returns_void (void) __attribute((malloc)); // expected-warning {{attribute only applies to r…
12 int returns_int (void) __attribute((malloc)); // expected-warning {{attribute only applies to r…
13 int * returns_intptr(void) __attribute((malloc)); // no-warning
15 iptr returns_iptr (void) __attribute((malloc)); // no-warning
17 __attribute((malloc)) void *(*f)(void); // expected-warning{{attribute only applies to functions}}
18 __attribute((malloc)) int (*g)(void); // expected-warning{{attribute only applies to functions}}
20 __attribute((malloc))
21 void * xalloc(unsigned n) { return malloc(n); } // no-warning in xalloc()
[all …]
H A Dwarn-free-nonheap-object.cpp7 void *malloc(size_t);
38 char *ptr1 = (char *)std::malloc(10);
39 char *ptr2 = (char *)std::malloc(10);
40 char *ptr3 = (char *)std::malloc(10);
64 void *P = std::malloc(8); in test1()
104 void *P = std::malloc(8); in test2()
108 char* P = (char *)std::malloc(2); in test2()
112 char* P = (char *)std::malloc(2); in test2()
/llvm-project-15.0.7/clang-tools-extra/test/clang-tidy/checkers/bugprone/
H A Dmisplaced-operator-in-strlen-in-alloc.c4 void *malloc(size_t);
20 char *new_name = (char *)malloc(strlen(name + 1)); in bad_malloc()
23 new_name = (char *)malloc(strnlen(name + 1, 10)); in bad_malloc()
26 new_name = (char *)malloc(strnlen_s(name + 1, 10)); in bad_malloc()
32 wchar_t *new_name = (wchar_t *)malloc(wcslen(name + 1)); in bad_malloc_wide()
35 new_name = (wchar_t *)malloc(wcsnlen(name + 1, 10)); in bad_malloc_wide()
38 new_name = (wchar_t *)malloc(wcsnlen_s(name + 1, 10)); in bad_malloc_wide()
62 char *new_name = (char *)malloc(strlen(name + 1) + 1); in intentional1()
68 char *new_name = (char *)malloc(strlen(name + 2)); in intentional2()
74 char *new_name = (char *)malloc(strlen((name + 1))); in intentional3()
[all …]
H A Dmisplaced-pointer-arithmetic-in-alloc.c4 void *malloc(size_t);
10 char *p = (char *)malloc(n) + 10; in bad_malloc()
14 p = (char *)malloc(n) - 10; in bad_malloc()
18 p = (char *)malloc(n) + n; in bad_malloc()
22 p = (char *)malloc(n) - (n + 10); in bad_malloc()
26 p = (char *)malloc(n) - n + 10; in bad_malloc()
50 void (*(*const alloc_ptr)(size_t)) = malloc;
/llvm-project-15.0.7/llvm/test/Transforms/InstCombine/
H A Dcompare-unescaped.ll12 %m = call i8* @malloc(i64 4)
23 %m = call i8* @malloc(i64 4)
41 %m = call i8* @malloc(i64 24)
56 %m = call i8* @malloc(i64 24)
74 %m = call i8* @malloc(i64 24)
98 %m = call i8* @malloc(i64 24)
116 %m = call i8* @malloc(i64 4)
117 %n = call i8* @malloc(i64 4)
128 %m = call i8* @malloc(i64 4)
143 %m = call i8* @malloc(i64 4)
[all …]
H A Dmalloc_free_delete_nvptx.ll7 declare i8* @malloc(i64) allockind("alloc,uninitialized") "alloc-family"="malloc" allocsize(0)
8 declare void @free(i8*) allockind("free") "alloc-family"="malloc"
10 ; Ensure the nvptx backend states malloc & free are a thing so we can recognize
11 ; so we will optimize them properly. In the test below the malloc-free chain is
12 ; useless and we can remove it *if* we know about malloc & free.
17 %a = call i8* @malloc(i64 4)
25 ; CHECK-NEXT: [[A:%.*]] = call dereferenceable_or_null(4) i8* @malloc(i64 4)
30 %a = call i8* @malloc(i64 4)
/llvm-project-15.0.7/compiler-rt/test/scudo/
H A Dquarantine.c27 p = malloc(size); in main()
30 p = malloc(size + 1); in main()
44 p = malloc(size); in main()
53 p = malloc(size); in main()
57 p = malloc(size); in main()
65 p = malloc(size); in main()
76 p = malloc(size + 1); in main()
87 p = malloc(size); in main()
102 p = malloc(size); in main()
115 p = malloc(1U << 19); in main()
/llvm-project-15.0.7/clang/test/SemaObjC/
H A Dattr-malloc.m4 - (id) test1 __attribute((malloc)); // expected-warning {{attribute only applies to functions}} argument
5 - (int) test2 __attribute((malloc)); // expected-warning {{attribute only applies to functions}} argument
8 id bar(void) __attribute((malloc)); // no-warning
11 bptr baz(void) __attribute((malloc)); // no-warning
13 __attribute((malloc)) id (*f)(void); // expected-warning {{attribute only applies to functions}}
14 __attribute((malloc)) bptr (*g)(void); // expected-warning {{attribute only applies to functions}}
15 __attribute((malloc)) void *(^h)(void); // expected-warning {{attribute only applies to functions}}

12345678910>>...42