[llvm-commits] [PATCH] New sanitizer allocator that works in 32-bits. Only basic functionality so far.
Dmitry Vyukov
dvyukov at google.com
Thu Dec 6 04:41:40 PST 2012
Looks good
================
Comment at: sanitizer_common/sanitizer_allocator.h:337
@@ +336,3 @@
+ CHECK(CanAllocate(size, alignment));
+ return AllocateBySizeClass(SizeClassMap::ClassID(size));
+ }
----------------
This does not provide requested alignment.
================
Comment at: sanitizer_common/sanitizer_allocator.h:319
@@ +318,3 @@
+// A Region looks like this:
+// UserChunk1 .. UserChunkN <gap> MetaChunk1 .. MetaChunkN
+//
----------------
It's MetaChunkN .. MetaChunk1
================
Comment at: sanitizer_common/sanitizer_allocator.h:346
@@ +345,3 @@
+ void *GetMetaData(void *p) {
+ uptr mem = reinterpret_cast<uptr>(p);
+ uptr beg = ComputeRegionBeg(mem);
----------------
CHECK(PointerIsMine(p));
================
Comment at: sanitizer_common/sanitizer_allocator.h:394
@@ +393,3 @@
+ AllocatorFreeList free_list;
+ char padding[kCacheLineSize - sizeof(uptr) - sizeof (AllocatorFreeList)];
+ };
----------------
sizeof(SpinMutex)
================
Comment at: sanitizer_common/sanitizer_allocator.h:451
@@ +450,3 @@
+ u8 possible_regions_[kNumPossibleRegions];
+ SizeClassInfo size_class_info_array_[kNumClasses];
+};
----------------
SizeClassAllocator32 must be cache-line aligned itself
http://llvm-reviews.chandlerc.com/D183
More information about the llvm-commits
mailing list