Refactor checks to improve codegen.

This commit is contained in:
Matthew Parkinson
2021-03-17 18:41:56 +00:00
committed by Matthew Parkinson
parent 0983f1837b
commit ed615eade9
4 changed files with 73 additions and 89 deletions

View File

@@ -81,10 +81,7 @@ namespace snmalloc
dealloc_fast(Slab* self, Superslab* super, void* p)
{
Metaslab& meta = super->get_meta(self);
#ifdef CHECK_CLIENT
if (meta.is_unused())
error("Detected potential double free.");
#endif
SNMALLOC_ASSERT(!meta.is_unused());
if (unlikely(meta.return_object()))
return false;