diff options
author | Yaron Keren <yaron.keren@gmail.com> | 2015-07-09 07:53:23 +0000 |
---|---|---|
committer | Yaron Keren <yaron.keren@gmail.com> | 2015-07-09 07:53:23 +0000 |
commit | 45a5bfef44c1e0a825e695ced1f9a91641042171 (patch) | |
tree | 74437ea20dd700fdf3fda8c5af19fa76265487da /clang/tools/libclang/BuildSystem.cpp | |
parent | 37a4da825f3fc3845cb66e46b9bead240666955c (diff) | |
download | bcm5719-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.cpp | 4 |
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); } |