mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Allow FoldingSet clients to pump up the initial hash size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -151,8 +151,10 @@ static void **GetBucketFor(const FoldingSetImpl::NodeID &ID,
|
||||
//===----------------------------------------------------------------------===//
|
||||
// FoldingSetImpl Implementation
|
||||
|
||||
FoldingSetImpl::FoldingSetImpl() : NumNodes(0) {
|
||||
NumBuckets = 64;
|
||||
FoldingSetImpl::FoldingSetImpl(unsigned Log2InitSize) : NumNodes(0) {
|
||||
assert(5 < Log2InitSize && Log2InitSize < 32 &&
|
||||
"Initial hash table size out of range");
|
||||
NumBuckets = 1 << Log2InitSize;
|
||||
Buckets = new void*[NumBuckets];
|
||||
memset(Buckets, 0, NumBuckets*sizeof(void*));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user