mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
Revert r325224 "Report fatal error in the case of out of memory"
It caused fails on some buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325227 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -57,9 +57,10 @@ void StringMapImpl::init(unsigned InitSize) {
|
||||
NumItems = 0;
|
||||
NumTombstones = 0;
|
||||
|
||||
TheTable = static_cast<StringMapEntryBase **>(
|
||||
std::calloc(NewNumBuckets+1,
|
||||
sizeof(StringMapEntryBase **) + sizeof(unsigned)));
|
||||
TheTable = (StringMapEntryBase **)calloc(NewNumBuckets+1,
|
||||
sizeof(StringMapEntryBase **) +
|
||||
sizeof(unsigned));
|
||||
|
||||
if (TheTable == nullptr)
|
||||
report_bad_alloc_error("Allocation of StringMap table failed.");
|
||||
|
||||
@@ -218,8 +219,10 @@ unsigned StringMapImpl::RehashTable(unsigned BucketNo) {
|
||||
unsigned NewBucketNo = BucketNo;
|
||||
// Allocate one extra bucket which will always be non-empty. This allows the
|
||||
// iterators to stop at end.
|
||||
StringMapEntryBase **NewTableArray = static_cast<StringMapEntryBase **>(
|
||||
std::calloc(NewSize+1, sizeof(StringMapEntryBase *) + sizeof(unsigned)));
|
||||
StringMapEntryBase **NewTableArray =
|
||||
(StringMapEntryBase **)calloc(NewSize+1, sizeof(StringMapEntryBase *) +
|
||||
sizeof(unsigned));
|
||||
|
||||
if (NewTableArray == nullptr)
|
||||
report_bad_alloc_error("Allocation of StringMap hash table failed.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user