Chandler Carruth
9df0fd4018
[Allocator] Lift the slab size and size threshold into template
...
parameters rather than runtime parameters.
There is only one user of these parameters and they are compile time for
that user. Making these compile time seems to better reflect their
intended usage as well.
llvm-svn: 205143
2014-03-30 12:07:07 +00:00
Chandler Carruth
a05a221e63
[Allocator] Simplify unittests by using the default size parameters in
...
more places.
llvm-svn: 205141
2014-03-30 11:36:32 +00:00
Nick Kledzik
4d6d981297
Fix layering StringRef copy using BumpPtrAllocator.
...
Now to copy a string into a BumpPtrAllocator and get a StringRef to the copy:
StringRef myCopy = myStr.copy(myAllocator);
llvm-svn: 200885
2014-02-05 22:22:56 +00:00
Nick Kledzik
15bcb9dc42
Add BumpPtrAllocator::allocateCopy() utilities
...
Makes it easy to use BumpPtrAllocator to make a copy of StringRef strings.
llvm-svn: 200331
2014-01-28 19:21:27 +00:00
Chandler Carruth
130cec21b9
Sort the #include lines for unittest/...
...
llvm-svn: 169250
2012-12-04 10:23:08 +00:00
Benjamin Kramer
f7e02a0cab
BumpPtrAllocator: Make sure threshold cannot be initialized with a value smaller than the slab size.
...
This replaces r151834 with a simpler fix.
llvm-svn: 151842
2012-03-01 22:10:16 +00:00
Argyrios Kyrtzidis
16558f4d3b
If BumpPtrAllocator is requested to allocate a size that exceeds the slab size,
...
increase the slab size.
llvm-svn: 151834
2012-03-01 20:36:32 +00:00
Dan Gohman
01b443fdd3
Spelling fixes.
...
llvm-svn: 97454
2010-03-01 17:51:02 +00:00
Benjamin Kramer
9ace8b5763
Fix unit test on FreeBSD. We need to make sure there is enough space to save the pointer even if the memory returned from malloc was already aligned.
...
llvm-svn: 78805
2009-08-12 12:31:02 +00:00
Reid Kleckner
4b1f2f4779
Added a test and fixed a bug in BumpPtrAllocator relating to large alignment
...
values. Hopefully this fixes PR4622.
llvm-svn: 77088
2009-07-25 21:26:02 +00:00
Reid Kleckner
c2d882dd1a
Re-committing changes from r76825 to BumpPtrAllocator with a fix and tests for
...
an off-by-one error.
llvm-svn: 76891
2009-07-23 18:34:13 +00:00
Reid Kleckner
921673225c
Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
...
llvm-svn: 76838
2009-07-23 01:40:54 +00:00
Reid Kleckner
5bd6105d65
Parameterize the BumpPtrAllocator over a slab allocator. It defaults to using
...
malloc, so there should be no functional changes to other code.
These changes are necessary since I have plans to use this allocator in the JIT
memory manager, and it needs a special allocator.
I also added some tests which helped me pinpoint some bugs.
llvm-svn: 76825
2009-07-23 00:30:41 +00:00