summaryrefslogtreecommitdiff
path: root/absl/container/internal/container_memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/container/internal/container_memory.h')
-rw-r--r--absl/container/internal/container_memory.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/absl/container/internal/container_memory.h b/absl/container/internal/container_memory.h
index f59ca4ee..a735ca34 100644
--- a/absl/container/internal/container_memory.h
+++ b/absl/container/internal/container_memory.h
@@ -249,6 +249,14 @@ inline void SanitizerUnpoisonObject(const T* object) {
SanitizerUnpoisonMemoryRegion(object, sizeof(T));
}
+template <typename Container, typename Alloc, typename F>
+void RunWithReentrancyGuard(Container& c, Alloc& a, F f) {
+ SanitizerPoisonObject(&c);
+ if (!std::is_empty<Alloc>()) SanitizerUnpoisonObject(&a);
+ f();
+ SanitizerUnpoisonObject(&c);
+}
+
namespace memory_internal {
// If Pair is a standard-layout type, OffsetOf<Pair>::kFirst and