summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2014-02-06 06:56:22 +0000
committerKostya Serebryany <kcc@google.com>2014-02-06 06:56:22 +0000
commitf403d8dbce91a4196a67570cef3259a16999e3c2 (patch)
tree6eff94249b0744cfae15bf8a9fc36e527dc05311 /include
parente2cdf0bda99368cfb311d89719ef39b7197f30a7 (diff)
[asan] introduce two functions that will allow implementations of C++ garbage colection to work with asan's fake stack
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/sanitizer/asan_interface.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h
index a943cfe34..045ca954b 100644
--- a/include/sanitizer/asan_interface.h
+++ b/include/sanitizer/asan_interface.h
@@ -122,6 +122,24 @@ extern "C" {
// deallocation of "ptr".
void __asan_malloc_hook(void *ptr, size_t size);
void __asan_free_hook(void *ptr);
+
+ // The following 2 functions facilitate garbage collection in presence of
+ // asan's fake stack.
+
+ // Returns an opaque handler to be used later in __asan_addr_is_in_fake_stack.
+ // Returns NULL if the current thread does not have a fake stack.
+ void *__asan_get_current_fake_stack();
+
+ // If fake_stack is non-NULL and addr belongs to a fake frame in
+ // fake_stack, returns the address on real stack that corresponds to
+ // the fake frame and sets beg/end to the boundaries of this fake frame.
+ // Otherwise returns NULL and does not touch beg/end.
+ // If beg/end are NULL, they are not touched.
+ // This function may be called from a thread other than the owner of
+ // fake_stack, but the owner thread need to be alive.
+ void *__asan_addr_is_in_fake_stack(void *fake_stack, void *addr, void **beg,
+ void **end);
+
#ifdef __cplusplus
} // extern "C"
#endif