зеркало из https://github.com/microsoft/snmalloc.git
Add a default constructor to seqset nodes. (#636)
This allows them to exist as fields without invalidating the set. This should make it possible to remove the undefined behaviour in the creation of FrontendSlabMetadata, which is currently created via a reinterpret_cast from a different-typed allocation. FrontendSlabMetadata has a SeqSet::Node field that is in an unspecified state on construction and which is valid only when inserted into a SeqSet.
This commit is contained in:
Родитель
2a7670eb82
Коммит
126e77f2a5
|
@ -34,6 +34,9 @@ namespace snmalloc
|
|||
constexpr Node(Node* next, Node* prev) : next(next), prev(prev) {}
|
||||
|
||||
public:
|
||||
/// Default constructor, creates an invalid node.
|
||||
constexpr Node() : Node(nullptr, nullptr) {}
|
||||
|
||||
void invariant()
|
||||
{
|
||||
SNMALLOC_ASSERT(next != nullptr);
|
||||
|
|
Загрузка…
Ссылка в новой задаче