diff options
Diffstat (limited to 'compiler-rt/lib/scudo/standalone/bytemap.h')
| -rw-r--r-- | compiler-rt/lib/scudo/standalone/bytemap.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler-rt/lib/scudo/standalone/bytemap.h b/compiler-rt/lib/scudo/standalone/bytemap.h index 2c8ba1fd0e8..ab009193616 100644 --- a/compiler-rt/lib/scudo/standalone/bytemap.h +++ b/compiler-rt/lib/scudo/standalone/bytemap.h @@ -22,6 +22,8 @@ public: } void init() { initLinkerInitialized(); } + void unmapTestOnly() { unmap(reinterpret_cast<void *>(Map), Size); } + void set(uptr Index, u8 Value) { DCHECK_LT(Index, Size); DCHECK_EQ(0U, Map[Index]); @@ -57,6 +59,12 @@ public: memset(Level1Map, 0, sizeof(atomic_uptr) * Level1Size); } + void unmapTestOnly() { + reset(); + unmap(reinterpret_cast<void *>(Level1Map), + sizeof(atomic_uptr) * Level1Size); + } + uptr size() const { return Level1Size * Level2Size; } void set(uptr Index, u8 Value) { |

