Bladeren bron

LibJS: Make sure all allocators are 8-byte aligned

Absolutely massive allocations > 1024 bytes would go into the size
class which was 3172 bytes. 3172 happens to not be 8 byte aligned, and
so made UBSAN very sad on x86_64. Change the largest allocator to be
3072 bytes, which is in fact a multiple of 8 :^)
Andrew Kaster 4 jaren geleden
bovenliggende
commit
f90a19ba4c
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      Userland/Libraries/LibJS/Heap/Heap.cpp

+ 1 - 1
Userland/Libraries/LibJS/Heap/Heap.cpp

@@ -30,7 +30,7 @@ Heap::Heap(VM& vm)
     m_allocators.append(make<Allocator>(256));
     m_allocators.append(make<Allocator>(512));
     m_allocators.append(make<Allocator>(1024));
-    m_allocators.append(make<Allocator>(3172));
+    m_allocators.append(make<Allocator>(3072));
 }
 
 Heap::~Heap()