Changeset 5416 for trunk/tango/util/container/LinkedList.d
- Timestamp:
- 03/21/10 14:15:40 (2 years ago)
- Files:
-
- trunk/tango/util/container/LinkedList.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tango/util/container/LinkedList.d
r5064 r5416 133 133 /*********************************************************************** 134 134 135 Return the configured allocator136 137 ***********************************************************************/138 139 final Alloc allocator ()140 {141 return heap;142 }143 144 /***********************************************************************145 146 135 Return a generic iterator for contained elements 147 136 … … 156 145 i.owner = this; 157 146 return i; 147 } 148 149 /*********************************************************************** 150 151 Configure the assigned allocator with the size of each 152 allocation block (number of nodes allocated at one time) 153 and the number of nodes to pre-populate the cache with. 154 155 Time complexity: O(n) 156 157 ***********************************************************************/ 158 159 final LinkedList cache (size_t chunk, size_t count=0) 160 { 161 heap.config (chunk, count); 162 return this; 158 163 } 159 164 … … 1123 1128 // use a chunk allocator, and presize the bucket[] 1124 1129 auto test = new LinkedList!(int, Container.reap, Container.Chunk); 1125 test. allocator.config (2000, 500);1130 test.cache (2000, 1_000_000); 1126 1131 const count = 1_000_000; 1127 1132 StopWatch w;












