Skip to content

Commit 30e90ed

Browse files
committed
Fixup replay
1 parent 1297982 commit 30e90ed

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/rt/ds/heap.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@
44
#include <snmalloc/snmalloc.h>
55
#include <test/xoroshiro.h>
66

7-
#if __has_feature(address_sanitizer)
7+
#if defined(__SANITIZE_ADDRESS__)
8+
# define HAS_ASAN
9+
#elif defined(__has_feature)
10+
# if __has_feature(address_sanitizer)
11+
# define HAS_ASAN
12+
# endif
13+
#endif
14+
15+
#if defined(HAS_ASAN)
816
# include <sanitizer/asan_interface.h>
917
// Asan does not appear to support a __asan_update_deallocation_context
1018
# define VERONA_TRACK_FREE(ptr, size) __asan_poison_memory_region(ptr, size);
1119
# define VERONA_TRACK_ALLOC(ptr, size) __asan_unpoison_memory_region(ptr, size); __asan_update_allocation_context(ptr);
1220
# define VERONA_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
1321
#else
14-
# define VERONA_POISON_MEMORY(ptr, size)
15-
# define VERONA_UNPOISON_MEMORY(ptr, size)
22+
# define VERONA_TRACK_FREE(ptr, size)
23+
# define VERONA_TRACK_ALLOC(ptr, size)
1624
# define VERONA_NO_SANITIZE_ADDRESS
1725
#endif
1826

test/func/replayalloc/replayalloc.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ int main(int argc, char** argv)
4747
heap::set_seed(i + t);
4848
test_replay();
4949
heap::debug_check_empty();
50+
if (i % 64 == 0)
51+
{
52+
std::cout << std::endl;
53+
}
5054
}
5155

5256
std::cout << std::endl << "count: " << count << std::endl;

0 commit comments

Comments
 (0)