File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 6b0c4822c10d1e0824043f81fc9e39096cc40172
5
+ refs/heads/try: 38b2b74413da1d982df82fbb9552373b7dc52e69
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -204,14 +204,8 @@ memory_region::claim_alloc(void *mem) {
204
204
205
205
void
206
206
memory_region::maybe_poison (void *mem) {
207
- // TODO: We should lock this, in case the compiler doesn't.
208
- static int poison = -1 ;
209
- if (poison < 0 ) {
210
- char *env_str = getenv (" RUST_POISON_ON_FREE" );
211
- poison = env_str != NULL && env_str[0 ] != ' \0 ' ;
212
- }
213
207
214
- if (!poison )
208
+ if (!_srv-> env -> poison_on_free )
215
209
return ;
216
210
217
211
# if RUSTRT_TRACK_ALLOCATIONS >= 1
Original file line number Diff line number Diff line change 13
13
#define CHECK_CLAIMS " CHECK_CLAIMS"
14
14
#define DETAILED_LEAKS " DETAILED_LEAKS"
15
15
#define RUST_SEED " RUST_SEED"
16
+ #define RUST_POISON_ON_FREE " RUST_POISON_ON_FREE"
16
17
17
18
#if defined(__WIN32__)
18
19
static int
@@ -116,6 +117,7 @@ load_env() {
116
117
env->check_claims = getenv (CHECK_CLAIMS) != NULL ;
117
118
env->detailed_leaks = getenv (DETAILED_LEAKS) != NULL ;
118
119
env->rust_seed = copyenv (RUST_SEED);
120
+ env->poison_on_free = getenv (RUST_POISON_ON_FREE) != NULL ;
119
121
120
122
return env;
121
123
}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ struct rust_env {
6
6
bool check_claims ;
7
7
bool detailed_leaks ;
8
8
char * rust_seed ;
9
+ bool poison_on_free ;
9
10
};
10
11
11
12
rust_env * load_env ();
You can’t perform that action at this time.
0 commit comments