summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/BuildSystem.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/tools/libclang/BuildSystem.cpp
parent37a4da825f3fc3845cb66e46b9bead240666955c (diff)
downloadbcm5719-llvm-45a5bfef44c1e0a825e695ced1f9a91641042171.tar.gz
bcm5719-llvm-45a5bfef44c1e0a825e695ced1f9a91641042171.zip
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/tools/libclang/BuildSystem.cpp')
-rw-r--r--clang/tools/libclang/BuildSystem.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/tools/libclang/BuildSystem.cpp b/clang/tools/libclang/BuildSystem.cpp
index e9423c32869..fe3db755eba 100644
--- a/clang/tools/libclang/BuildSystem.cpp
+++ b/clang/tools/libclang/BuildSystem.cpp
@@ -84,6 +84,10 @@ clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay VFO, unsigned,
return CXError_Success;
}
+void clang_free(void *buffer) {
+ free(buffer);
+}
+
void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay VFO) {
delete unwrap(VFO);
}
OpenPOWER on IntegriCloud