diff --git a/Kernel/Heap/SlabAllocator.cpp b/Kernel/Heap/SlabAllocator.cpp index 0aed1747a90..b2a4416faa1 100644 --- a/Kernel/Heap/SlabAllocator.cpp +++ b/Kernel/Heap/SlabAllocator.cpp @@ -29,6 +29,8 @@ #include #include +#define SANITIZE_SLABS + namespace Kernel { template @@ -63,7 +65,7 @@ public: m_freelist = m_freelist->next; ++m_num_allocated; --m_num_free; -#ifdef SANITIZE_KMALLOC +#ifdef SANITIZE_SLABS memset(ptr, SLAB_ALLOC_SCRUB_BYTE, slab_size()); #endif return ptr; @@ -78,7 +80,7 @@ public: return; } ((FreeSlab*)ptr)->next = m_freelist; -#ifdef SANITIZE_KMALLOC +#ifdef SANITIZE_SLABS if (slab_size() > sizeof(FreeSlab*)) memset(((FreeSlab*)ptr)->padding, SLAB_DEALLOC_SCRUB_BYTE, sizeof(FreeSlab::padding)); #endif