OSDN Git Service

BumpPtrAllocator: remove 'no slabs allocated yet' check
authorHans Wennborg <hans@hanshq.net>
Sun, 17 Aug 2014 18:31:18 +0000 (18:31 +0000)
committerHans Wennborg <hans@hanshq.net>
Sun, 17 Aug 2014 18:31:18 +0000 (18:31 +0000)
commit61760cece0de0136ee01706748f8bb3977bfcf24
tree4108f1b2b951fd755b13ebc0ae8e9d8ef2488f72
parentdb7cdc8eb06485bb36e6cac1105d40cc3930021a
BumpPtrAllocator: remove 'no slabs allocated yet' check

We already handle the no-slabs case when checking whether the current slab
is large enough: if no slabs have been allocated, CurPtr and End are both 0.
alignPtr(0), will still be 0, and so "if (Ptr + Size <= End)" fails.

Differential Revision: http://reviews.llvm.org/D4943

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215841 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/Allocator.h
unittests/Support/AllocatorTest.cpp