summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/memory/poison.h
blob: 9519f3da10e8618b77e12fcea547723c7526290e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include "ref.h"

namespace NYT {

////////////////////////////////////////////////////////////////////////////////

//! In release builds, does nothing.
//! In checked builds, clobbers memory with garbage pattern.
//! In sanitized builds, invokes sanitizer poisoning.
void PoisonMemory(TMutableRef ref);

//! In release builds, does nothing.
//! In checked builds, clobbers memory with (another) garbage pattern.
//! In sanitized builds, invokes sanitizer unpoisoning.
void UnpoisonMemory(TMutableRef ref);

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT

#define POISON_INL_H_
#include "poison-inl.h"
#undef POISON_INL_H_