[PATCH] BumpPtrAllocator: don't accept 0 for the alignment parameter

Hans Wennborg hans at chromium.org
Sun Aug 17 12:40:11 PDT 2014


Hi majnemer,

It seems unnecessary to have to use an extra branch to check for this special case.

I couldn't measure any performance difference. Perhaps Clang inlines and removes the check most of the time, but I still think it's worth fixing.

http://reviews.llvm.org/D4945

Files:
  include/llvm/Support/Allocator.h
  unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
  unittests/Support/AllocatorTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4945.12592.patch
Type: text/x-patch
Size: 3922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140817/dca67062/attachment.bin>


More information about the llvm-commits mailing list