Revert "Add type confusion protection to the default memory provider."

This reverts commit d56201e28d.
This commit is contained in:
David Chisnall
2019-09-12 17:16:48 +01:00
parent dbea595b6e
commit 0b2b4d68a2
6 changed files with 14 additions and 29 deletions

View File

@@ -42,25 +42,6 @@ namespace snmalloc
}
};
/**
* A singleton global. Used to allow globals in headers. Precisely one
* instance of the static field will exist in the final program, irrespective
* of the number of compilation units that reference the field.
*
* C++ globals do not have their types as part of the name mangling, so this
* allows a singleton instance of a specific type that won't be confused with
* other template instantiations of the same type.
*/
template<class T>
struct TypedSingleton
{
/**
* The global variable, which will have a mangled name that includes the
* type of `T`.
*/
static inline T global;
};
/**
* Wrapper for wrapping values.
*