aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/libclang/LibclangTest.cpp
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-07-09 07:53:23 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-07-09 07:53:23 +0000
commit45a5bfef44c1e0a825e695ced1f9a91641042171 (patch)
tree74437ea20dd700fdf3fda8c5af19fa76265487da /clang/unittests/libclang/LibclangTest.cpp
parent37a4da825f3fc3845cb66e46b9bead240666955c (diff)
downloadllvm-45a5bfef44c1e0a825e695ced1f9a91641042171.zip
llvm-45a5bfef44c1e0a825e695ced1f9a91641042171.tar.gz
llvm-45a5bfef44c1e0a825e695ced1f9a91641042171.tar.bz2
Add clang_free to libclang to free memory allocated in libclang.
One of the problems libclang tests has running under Windows is memory allocated in libclang.dll but being freed in the test executable, possibly by a different memory manager. This patch exposes a new export function, clang_free(), used to free any allocated memory with the same libclang.dll memory manager that allocated the memory. http://reviews.llvm.org/D10949 Reviewed by Reid Kleckner, Douglas Gregor. llvm-svn: 241789
Diffstat (limited to 'clang/unittests/libclang/LibclangTest.cpp')
-rw-r--r--clang/unittests/libclang/LibclangTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/libclang/LibclangTest.cpp b/clang/unittests/libclang/LibclangTest.cpp
index e827ebc..becebf0 100644
--- a/clang/unittests/libclang/LibclangTest.cpp
+++ b/clang/unittests/libclang/LibclangTest.cpp
@@ -63,7 +63,7 @@ struct TestVFO {
clang_VirtualFileOverlay_writeToBuffer(VFO, 0, &BufPtr, &BufSize);
std::string BufStr(BufPtr, BufSize);
EXPECT_STREQ(Contents, BufStr.c_str());
- free(BufPtr);
+ clang_free(BufPtr);
}
clang_VirtualFileOverlay_dispose(VFO);
}
@@ -345,7 +345,7 @@ TEST(libclang, ModuleMapDescriptor) {
clang_ModuleMapDescriptor_writeToBuffer(MMD, 0, &BufPtr, &BufSize);
std::string BufStr(BufPtr, BufSize);
EXPECT_STREQ(Contents, BufStr.c_str());
- free(BufPtr);
+ clang_free(BufPtr);
clang_ModuleMapDescriptor_dispose(MMD);
}