summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Allocator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge System into Support.Michael J. Spencer2010-11-291-2/+2
| | | | llvm-svn: 120298
* Grow BumpPtrAllocator's slab size dynamically if we allocated many slabs. ThisBenjamin Kramer2010-09-301-0/+6
| | | | | | | | | | | | | | | | | | | | | reduces the amount of malloc calls and may reduce memory overhead. Some numbers: ASTContext stats, clang -cc1 -disable-free -fsyntax-only Cocoa_h.m without dynamic growth | with dynamic growth Number of memory regions: 3158 | Number of memory regions: 432 Bytes used: 12333185 | Bytes used: 12333185 Bytes allocated: 12935168 | Bytes allocated: 12800000 Bytes wasted: 601983 (includes alignment, etc) | Bytes wasted: 466815 (includes alignment, etc) ASTContext stats, clang -cc1 -disable-free -fsyntax-only on clang's ASTReader.cpp without dynamic growth | with dynamic growth Number of memory regions: 10987 | Number of memory regions: 551 Bytes used: 42910356 | Bytes used: 42910356 Bytes allocated: 45002752 | Bytes allocated: 44711936 Bytes wasted: 2092396 (includes alignment, etc) | Bytes wasted: 1801580 (includes alignment, etc) llvm-svn: 115151
* BumpPtrAllocator::Reset() doesn't need to allocate anything. (Thanks, Jakob)Benjamin Kramer2010-04-131-2/+2
| | | | llvm-svn: 101138
* Let BumpPtrAllocator lazily allocate the first slab.Benjamin Kramer2010-04-131-3/+6
| | | | | | | We have some code in llvm and clang where a BumpPtrAllocator is declared in a class but never used in the common case. Stop wasting memory there. llvm-svn: 101130
* Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allowsBenjamin Kramer2010-03-301-15/+0
| | | | | | | only a single type of object to be allocated. Use it to make VNInfo destruction typesafe. llvm-svn: 99919
* Reapply r99881 with some fixes: only call destructor in releaseMemory!Torok Edwin2010-03-301-0/+15
| | | | llvm-svn: 99883
* Revert 99881, it brooke smooshlab's llvm-gcc-i386-darwin9.Torok Edwin2010-03-301-15/+0
| | | | llvm-svn: 99882
* Introduce another Reset() method in BumpPtrAllocator that calls a destructorTorok Edwin2010-03-301-0/+15
| | | | | | | | | | on all objects it has allocated, if they are all of the same size and alignment. Use this to destruct all VNInfos allocated in LiveIntervalAnalysis (PR6653). valnos is not reliable for this purpose, as seen in r99400 (which still leaked, and sometimes caused double frees). llvm-svn: 99881
* Temporarily revert r93581. It was causing failures in the ExecutionEngine testsBill Wendling2010-01-161-4/+2
| | | | | | on the build bots. llvm-svn: 93606
* BumpPtrAllocator: Have the DefaultSlabAllocator created at runtime, not ↵Ted Kremenek2010-01-151-2/+4
| | | | | | initialization time. This removes one of the 'init_constructors' reported in <rdar://problem/7545356>. llvm-svn: 93581
* Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth2009-10-261-1/+1
| | | | | | direct inclusion edge from System to Support. llvm-svn: 85086
* Make sure the memory range is writable before memset'ing it.Evan Cheng2009-09-091-0/+2
| | | | llvm-svn: 81308
* Added a test and fixed a bug in BumpPtrAllocator relating to large alignmentReid Kleckner2009-07-251-2/+2
| | | | | | values. Hopefully this fixes PR4622. llvm-svn: 77088
* Switch to raw_ostream.Daniel Dunbar2009-07-241-9/+9
| | | | llvm-svn: 76943
* Re-committing changes from r76825 to BumpPtrAllocator with a fix and tests forReid Kleckner2009-07-231-105/+133
| | | | | | an off-by-one error. llvm-svn: 76891
* Reverting r76825 and r76828, since they caused clang runtime errors and some ↵Reid Kleckner2009-07-231-132/+104
| | | | | | build failure involving memset. llvm-svn: 76838
* add header for 'memset'.Zhongxing Xu2009-07-231-0/+1
| | | | llvm-svn: 76837
* Parameterize the BumpPtrAllocator over a slab allocator. It defaults to usingReid Kleckner2009-07-231-104/+131
| | | | | | | | | | | 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
* Fold the useful features of alist and alist_node into ilist, andDan Gohman2008-07-281-2/+4
| | | | | | | | | | | | | | | | a new ilist_node class, and remove them. Unlike alist_node, ilist_node doesn't attempt to manage storage itself, so it avoids the associated problems, including being opaque in gdb. Adjust the Recycler class so that it doesn't depend on alist_node. Also, change it to use explicit Size and Align parameters, allowing it to work when the largest-sized node doesn't have the greatest alignment requirement. Change MachineInstr's MachineMemOperand list from a pool-backed alist to a std::list for now. llvm-svn: 54146
* Add some basic Pool-allocation infrastructure. This adds a Recycler class,Dan Gohman2008-07-071-0/+7
| | | | | | | | for handling bookkeeping for deleted objects, as well as the alist class template, for keeping lists of objects allocated from Recyclers, and some related utilities. llvm-svn: 53210
* Fix more -Wshorten-64-to-32 warnings.Evan Cheng2008-05-051-2/+2
| | | | llvm-svn: 50659
* Fix a pointer-arithmetic bug that caused 64-bit host pointer values toDan Gohman2008-04-281-1/+1
| | | | | | | be truncated to 32 bits. This fixes the recent Benchmarks/McCat/09-vor regression on x86-64, among other things. llvm-svn: 50372
* Bug fix in BumpPtrAllocator: don't assume that all objects have the same ↵Ted Kremenek2008-04-281-6/+9
| | | | | | alignment. "Bump" of the pointer for the next allocated object to be of the specified alignment. llvm-svn: 50362
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Smarter Reset(). Instead of deallocating all memory regions and reallocate theEvan Cheng2007-09-081-5/+17
| | | | | | first region, just deallocate all but the last region in the list. llvm-svn: 41782
* Added Reset() to free all allocated memory regions and reset state to be the ↵Evan Cheng2007-09-051-0/+6
| | | | | | same as right after ctor. llvm-svn: 41728
* Avoid TBAA issue.Chris Lattner2007-02-231-1/+4
| | | | llvm-svn: 34539
* Don't use <sstream> in Streams.h but <iosfwd> instead.Bill Wendling2006-12-071-0/+1
| | | | llvm-svn: 32340
* Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, areBill Wendling2006-12-071-2/+2
| | | | | | now cerr, cout, and NullStream resp. llvm-svn: 32298
* Removed #include <iostream> and replace with llvm_* streams.Bill Wendling2006-11-261-3/+3
| | | | llvm-svn: 31927
* Include llvm/Support/DataTypes.h to define intptr_t.John Criswell2006-11-081-0/+1
| | | | | | This fixes the build on OpenBSD and potentially other systems. llvm-svn: 31550
* Add a new llvm::Allocator abstraction, which will be used by a containerChris Lattner2006-10-291-0/+106
I'm about to add. This is similar to, but necessarily different than, the STL allocator class. llvm-svn: 31285
OpenPOWER on IntegriCloud