Lines Matching defs:malloc
8 void *malloc(size_t);
12 void __attribute((ownership_returns(malloc))) *my_malloc(size_t);
15 void __attribute((ownership_takes(malloc, 1))) my_free(void *);
34 //--------------- test malloc family
36 int *p = (int *)malloc(sizeof(int));
37 delete p; // expected-warning{{Memory allocated by 'malloc()' should be deallocated by 'free()', not 'delete'}}
41 int *p = (int *)malloc(8);
62 int *p = (int *)malloc(sizeof(int));
63 operator delete(p); // expected-warning{{Memory allocated by 'malloc()' should be deallocated by 'free()', not 'operator delete'}}
67 int *p = (int *)malloc(sizeof(int));
68 delete[] p; // expected-warning{{Memory allocated by 'malloc()' should be deallocated by 'free()', not 'delete[]'}}
72 int *p = (int *)malloc(sizeof(int));
73 operator delete[](p); // expected-warning{{Memory allocated by 'malloc()' should be deallocated by 'free()', not 'operator delete[]'}}
88 my_free(p); // expected-warning{{Memory allocated by 'my_malloc1()' should be deallocated by function that takes ownership of 'malloc1', not 'my_free()', which takes ownership of 'malloc'}}
200 int *p = (int *)malloc(sizeof(int));
206 int *p = (int *)malloc(sizeof(int));
212 int *p = (int *)malloc(sizeof(int));
222 // malloc()/free() are subjects of unix.Malloc and unix.MallocWithAnnotations
227 int *p1 = (int *)malloc(sizeof(int));
230 int *p2 = (int *)malloc(sizeof(int));
234 int *p3 = (int *)malloc(sizeof(int)); // no-warning
259 // expected-warning@-2 {{Memory allocated by 'malloc()' should be deallocated by 'free()', not 'delete'}}
279 SimpleSmartPointer<int> a((int *)malloc(4));