зеркало из https://github.com/microsoft/snmalloc.git
Code review changes.
This commit is contained in:
Родитель
255f54729b
Коммит
875c20202c
|
@ -155,12 +155,15 @@ namespace snmalloc
|
|||
*/
|
||||
static void clear(Contents p)
|
||||
{
|
||||
#ifdef SNMALLOC_CLEAN_POINTERS
|
||||
p->left = nullptr;
|
||||
p->right = nullptr;
|
||||
#else
|
||||
UNUSED(p);
|
||||
#endif
|
||||
if constexpr (CLEAN_POINTERS)
|
||||
{
|
||||
p->left = nullptr;
|
||||
p->right = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
UNUSED(p);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -225,6 +225,12 @@ namespace snmalloc
|
|||
#else
|
||||
static constexpr bool CHECK_CLIENT = false;
|
||||
#endif
|
||||
|
||||
#ifdef SNMALLOC_CLEAN_POINTERS
|
||||
static constexpr bool CLEAN_POINTERS = true;
|
||||
#else
|
||||
static constexpr bool CLEAN_POINTERS = false;
|
||||
#endif
|
||||
} // namespace snmalloc
|
||||
|
||||
#ifdef SNMALLOC_CHECK_CLIENT
|
||||
|
|
|
@ -192,12 +192,14 @@ namespace snmalloc
|
|||
*/
|
||||
void cleanup()
|
||||
{
|
||||
#ifdef SNMALLOC_CLEAN_POINTERS
|
||||
this->next_object = nullptr;
|
||||
# ifdef SNMALLOC_CHECK_CLIENT
|
||||
this->prev_encoded = 0;
|
||||
# endif
|
||||
#endif
|
||||
if constexpr (CLEAN_POINTERS)
|
||||
{
|
||||
this->next_object = nullptr;
|
||||
if constexpr (CHECK_CLIENT)
|
||||
{
|
||||
this->prev_encoded = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче