Changeset 5416 for trunk/tango/util/container/HashSet.d
- Timestamp:
- 03/21/10 14:15:40 (2 years ago)
- Files:
-
- trunk/tango/util/container/HashSet.d (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tango/util/container/HashSet.d
r5064 r5416 100 100 { 101 101 reset; 102 }103 104 /***********************************************************************105 106 Return the configured allocator107 108 ***********************************************************************/109 110 final Alloc allocator ()111 {112 return heap;113 102 } 114 103 … … 414 403 ***********************************************************************/ 415 404 416 final voidbuckets (size_t cap)405 final HashSet buckets (size_t cap) 417 406 { 418 407 if (cap < Container.defaultInitialBuckets) … … 421 410 if (cap !is buckets) 422 411 resize (cap); 412 return this; 423 413 } 424 414 … … 450 440 if (table) 451 441 checkLoad; 442 } 443 444 /*********************************************************************** 445 446 Configure the assigned allocator with the size of each 447 allocation block (number of nodes allocated at one time) 448 and the number of nodes to pre-populate the cache with. 449 450 Time complexity: O(n) 451 452 ***********************************************************************/ 453 454 final HashSet cache (size_t chunk, size_t count=0) 455 { 456 heap.config (chunk, count); 457 return this; 452 458 } 453 459 … … 841 847 // use a chunk allocator, and presize the bucket[] 842 848 auto test = new HashSet!(int, Container.hash, Container.reap, Container.Chunk); 843 test. allocator.config (1000, 1000);849 test.cache (1000, 1_000_000); 844 850 test.buckets = 1_500_000; 845 851 const count = 1_000_000;












