|
||
allocation.hGo to the documentation of this file.00001 // $Id: allocation.h,v 1.7 2003/08/07 23:14:22 pnav Exp $ 00002 // ---------------------------------------------------------------------- 00003 // 00004 // C-Breeze 00005 // C Compiler Framework 00006 // 00007 // Copyright (c) 2003 University of Texas at Austin 00008 // 00009 // Samuel Z. Guyer 00010 // Adam Brown 00011 // Teck Bok Tok 00012 // Paul Arthur Navratil 00013 // Calvin Lin 00014 // 00015 // Permission is hereby granted, free of charge, to any person 00016 // obtaining a copy of this software and associated documentation 00017 // files (the "Software"), to deal in the Software without 00018 // restriction, including without limitation the rights to use, copy, 00019 // modify, merge, publish, distribute, sublicense, and/or sell copies 00020 // of the Software, and to permit persons to whom the Software is 00021 // furnished to do so, subject to the following conditions: 00022 // 00023 // The above copyright notice and this permission notice shall be 00024 // included in all copies or substantial portions of the Software. 00025 // 00026 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00027 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00028 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00029 // NONINFRINGEMENT. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT 00030 // AUSTIN BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 00031 // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 00032 // OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00033 // THE SOFTWARE. 00034 // 00035 // We acknowledge the C-to-C Translator from MIT Laboratory for 00036 // Computer Science for inspiring parts of the C-Breeze design. 00037 // 00038 // ---------------------------------------------------------------------- 00039 00040 #ifdef CBZ_HEAPLAYERS 00041 00042 #include "heaplayers.h" 00043 #include "stlallocator.h" 00044 00045 // --- Main heap 00046 00047 class PointersHeap : public UniqueHeap< ZoneHeap < mallocHeap, 1024*1024 > > {}; 00048 00049 class FreelistFunHeap : public FreelistHeap<ZoneHeap<mallocHeap, 64 * 1024> > {}; 00050 00051 // --- Type-specific allocators for STL 00052 00053 class Location; 00054 typedef STLAllocator< Location *, FreelistFunHeap > location_alloc; 00055 00056 class memoryBlock; 00057 typedef STLAllocator< memoryBlock *, FreelistFunHeap > memoryblock_alloc; 00058 00059 class memoryDef; 00060 typedef STLAllocator< memoryDef *, FreelistFunHeap > memorydef_alloc; 00061 00062 class memoryUse; 00063 typedef STLAllocator< memoryUse *, FreelistFunHeap > memoryuse_alloc; 00064 00065 typedef STLAllocator< basicblockNode *, FreelistFunHeap > basicblock_alloc; 00066 00067 00068 #else 00069 00070 template <class T> 00071 class PerClassHeap {}; 00072 00073 class PointersHeap {}; 00074 class FreelistFunHeap {}; 00075 00076 class Location; 00077 typedef std::allocator< Location * > location_alloc; 00078 00079 class memoryBlock; 00080 typedef std::allocator< memoryBlock * > memoryblock_alloc; 00081 00082 class memoryDef; 00083 typedef std::allocator< memoryDef * > memorydef_alloc; 00084 00085 class memoryUse; 00086 typedef std::allocator< memoryUse * > memoryuse_alloc; 00087 00088 typedef std::allocator< basicblockNode * > basicblock_alloc; 00089 00090 #endif // 00091 |
Generated on August 27, 2003
Back to the C-Breeze home page