diff options
author | Francis Ricci <francisjricci@gmail.com> | 2017-04-11 20:05:02 +0000 |
---|---|---|
committer | Francis Ricci <francisjricci@gmail.com> | 2017-04-11 20:05:02 +0000 |
commit | ef3c0d303156bf2dbc222a292e9785cb66535a33 (patch) | |
tree | ba4b02d656bb243cf4dbc49d7282e8f2c4cc25cd /lib/lsan/lsan_allocator.h | |
parent | 73b0c20fc41d4ef48b9b2e3edecb705c2f6aaf77 (diff) |
Implement standalone lsan interceptors for OS X
Summary:
Mimicks the existing tsan and asan implementations of
Darwin interception.
Reviewers: kubamracek, kcc, glider
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D31889
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/lsan/lsan_allocator.h')
-rw-r--r-- | lib/lsan/lsan_allocator.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/lsan/lsan_allocator.h b/lib/lsan/lsan_allocator.h index bd19211c4..e5def17d4 100644 --- a/lib/lsan/lsan_allocator.h +++ b/lib/lsan/lsan_allocator.h @@ -36,6 +36,8 @@ void GetAllocatorCacheRange(uptr *begin, uptr *end); void AllocatorThreadFinish(); void InitializeAllocator(); +const bool kAlwaysClearMemory = true; + struct ChunkMetadata { u8 allocated : 8; // Must be first. ChunkTag tag : 2; @@ -72,6 +74,15 @@ typedef SizeClassAllocator64<AP64> PrimaryAllocator; typedef SizeClassAllocatorLocalCache<PrimaryAllocator> AllocatorCache; AllocatorCache *GetAllocatorCache(); + +void *lsan_memalign(uptr alignment, uptr size, const StackTrace &stack); +void *lsan_malloc(uptr size, const StackTrace &stack); +void lsan_free(void *p); +void *lsan_realloc(void *p, uptr size, const StackTrace &stack); +void *lsan_calloc(uptr nmemb, uptr size, const StackTrace &stack); +void *lsan_valloc(uptr size, const StackTrace &stack); +uptr lsan_mz_size(const void *p); + } // namespace __lsan #endif // LSAN_ALLOCATOR_H |