Skip to content

Commit

Permalink
scrub any stale race detector annotations from newly allocated memory
Browse files Browse the repository at this point in the history
  • Loading branch information
John Mellor-Crummey committed Jan 3, 2018
1 parent 2d4c889 commit 9a383aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions symtabAPI/src/Type-mem.h
Expand Up @@ -31,6 +31,8 @@
#if !defined(TYPE_MEM_H_)
#define TYPE_MEM_H_

#include <race-detector-annotations.h>

#include "symtabAPI/h/Type.h"
#include "boost/static_assert.hpp"
#include <utility>
Expand All @@ -57,6 +59,7 @@ T *upgradePlaceholder(Type *placeholder, T *new_type)
T *ret = new(mem) T();
assert(mem == (void *) ret);
*ret = *new_type;
race_detector_forget_access_history(ret, sizeof(T));
return ret;
}

Expand Down
1 change: 1 addition & 0 deletions symtabAPI/src/Type.C
Expand Up @@ -110,6 +110,7 @@ Type *Type::createPlaceholder(typeId_t ID, std::string name)
type_memory.insert(a, make_pair(mem, max_size));

Type *placeholder_type = new(mem) Type(name, ID, dataUnknownType);
race_detector_forget_access_history(placeholder_type, max_size);
return placeholder_type;
}

Expand Down

0 comments on commit 9a383aa

Please sign in to comment.