Skip to content

Commit 43de233

Browse files
author
Siva Chandra Reddy
committed
[libc][NFC] Remove allocator definition in the api-test.
The integration tests already have allocators so we will get all of them from there.
1 parent fc10715 commit 43de233

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

libc/test/IntegrationTest/test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@ void *malloc(size_t s) {
2929

3030
void free(void *) {}
3131

32+
void *realloc(void *ptr, size_t s) {
33+
free(ptr);
34+
return malloc(s);
35+
}
36+
3237
} // extern "C"

libc/utils/HdrGen/PrototypeTestGen/PrototypeTestGen.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ bool TestGeneratorMain(llvm::raw_ostream &OS, llvm::RecordKeeper &records) {
9595
OS << " return 0;\n";
9696
OS << "}\n\n";
9797

98-
// We provide dummy malloc and free implementations to support the case
99-
// when LLVM libc does to include them.
100-
OS << "void *malloc(size_t) __NOEXCEPT { return nullptr; }\n";
101-
OS << "void *realloc(void *, size_t) __NOEXCEPT { return nullptr; }\n";
102-
OS << "void free(void *) __NOEXCEPT {}\n";
103-
10498
return false;
10599
}
106100

0 commit comments

Comments
 (0)