Changeset 5416 for trunk/tango/util/container/CircularList.d
- Timestamp:
- 03/21/10 14:15:40 (2 years ago)
- Files:
-
- trunk/tango/util/container/CircularList.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tango/util/container/CircularList.d
r5131 r5416 131 131 /*********************************************************************** 132 132 133 Return the configured allocator134 135 ***********************************************************************/136 137 final Alloc allocator ()138 {139 return heap;140 }141 142 /***********************************************************************143 144 133 Return a generic iterator for contained elements 145 134 … … 157 146 i.index = 0; 158 147 return i; 148 } 149 150 /*********************************************************************** 151 152 Configure the assigned allocator with the size of each 153 allocation block (number of nodes allocated at one time) 154 and the number of nodes to pre-populate the cache with. 155 156 Time complexity: O(n) 157 158 ***********************************************************************/ 159 160 final CircularList cache (size_t chunk, size_t count=0) 161 { 162 heap.config (chunk, count); 163 return this; 159 164 } 160 165 … … 1187 1192 // use a chunk allocator, and presize the bucket[] 1188 1193 auto test = new CircularList!(uint, Container.reap, Container.Chunk); 1189 test. allocator.config (1000, 1000);1194 test.cache (1000, 1_000_000); 1190 1195 const count = 1_000_000; 1191 1196 StopWatch w;












