@@ -282,7 +282,7 @@ PLDHashTable::~PLDHashTable() {
282
282
AutoDestructorOp op (mChecker );
283
283
#endif
284
284
285
- if (!mEntryStore .Get ()) {
285
+ if (!mEntryStore .IsAllocated ()) {
286
286
return ;
287
287
}
288
288
@@ -318,7 +318,7 @@ MOZ_ALWAYS_INLINE auto PLDHashTable::SearchTable(const void* aKey,
318
318
PLDHashNumber aKeyHash,
319
319
Success&& aSuccess,
320
320
Failure&& aFailure) const {
321
- MOZ_ASSERT (mEntryStore .Get ());
321
+ MOZ_ASSERT (mEntryStore .IsAllocated ());
322
322
NS_ASSERTION (!(aKeyHash & kCollisionFlag ), "!(aKeyHash & kCollisionFlag )");
323
323
324
324
// Compute the primary hash address.
@@ -389,7 +389,7 @@ MOZ_ALWAYS_INLINE auto PLDHashTable::SearchTable(const void* aKey,
389
389
// to keys, which means callers can use complex key types more easily.
390
390
MOZ_ALWAYS_INLINE auto PLDHashTable::FindFreeSlot (PLDHashNumber aKeyHash) const
391
391
-> Slot {
392
- MOZ_ASSERT (mEntryStore .Get ());
392
+ MOZ_ASSERT (mEntryStore .IsAllocated ());
393
393
NS_ASSERTION (!(aKeyHash & kCollisionFlag ), "!(aKeyHash & kCollisionFlag )");
394
394
395
395
// Compute the primary hash address.
@@ -423,7 +423,7 @@ MOZ_ALWAYS_INLINE auto PLDHashTable::FindFreeSlot(PLDHashNumber aKeyHash) const
423
423
}
424
424
425
425
bool PLDHashTable::ChangeTable (int32_t aDeltaLog2) {
426
- MOZ_ASSERT (mEntryStore .Get ());
426
+ MOZ_ASSERT (mEntryStore .IsAllocated ());
427
427
428
428
// Look, but don't touch, until we succeed in getting new entry store.
429
429
int32_t oldLog2 = kPLDHashNumberBits - mHashShift ;
@@ -471,7 +471,7 @@ bool PLDHashTable::ChangeTable(int32_t aDeltaLog2) {
471
471
472
472
MOZ_ALWAYS_INLINE PLDHashNumber
473
473
PLDHashTable::ComputeKeyHash (const void * aKey) const {
474
- MOZ_ASSERT (mEntryStore .Get ());
474
+ MOZ_ASSERT (mEntryStore .IsAllocated ());
475
475
476
476
PLDHashNumber keyHash = mozilla::ScrambleHashCode (mOps ->hashKey (aKey));
477
477
@@ -489,7 +489,7 @@ PLDHashEntryHdr* PLDHashTable::Search(const void* aKey) const {
489
489
AutoReadOp op (mChecker );
490
490
#endif
491
491
492
- if (!mEntryStore .Get ()) {
492
+ if (!mEntryStore .IsAllocated ()) {
493
493
return nullptr ;
494
494
}
495
495
@@ -506,13 +506,13 @@ PLDHashEntryHdr* PLDHashTable::Add(const void* aKey,
506
506
#endif
507
507
508
508
// Allocate the entry storage if it hasn't already been allocated.
509
- if (!mEntryStore .Get ()) {
509
+ if (!mEntryStore .IsAllocated ()) {
510
510
uint32_t nbytes;
511
511
// We already checked this in the constructor, so it must still be true.
512
512
MOZ_RELEASE_ASSERT (
513
513
SizeOfEntryStore (CapacityFromHashShift (), mEntrySize , &nbytes));
514
514
mEntryStore .Set ((char *)calloc (1 , nbytes), &mGeneration );
515
- if (!mEntryStore .Get ()) {
515
+ if (!mEntryStore .IsAllocated ()) {
516
516
return nullptr ;
517
517
}
518
518
}
@@ -566,7 +566,7 @@ PLDHashEntryHdr* PLDHashTable::Add(const void* aKey,
566
566
PLDHashEntryHdr* PLDHashTable::Add (const void * aKey) {
567
567
PLDHashEntryHdr* entry = Add (aKey, fallible);
568
568
if (!entry) {
569
- if (!mEntryStore .Get ()) {
569
+ if (!mEntryStore .IsAllocated ()) {
570
570
// We OOM'd while allocating the initial entry storage.
571
571
uint32_t nbytes;
572
572
(void )SizeOfEntryStore (CapacityFromHashShift (), mEntrySize , &nbytes);
@@ -587,7 +587,7 @@ void PLDHashTable::Remove(const void* aKey) {
587
587
AutoWriteOp op (mChecker );
588
588
#endif
589
589
590
- if (!mEntryStore .Get ()) {
590
+ if (!mEntryStore .IsAllocated ()) {
591
591
return ;
592
592
}
593
593
@@ -623,7 +623,7 @@ void PLDHashTable::RawRemove(Slot& aSlot) {
623
623
// active, which doesn't fit well into how Checker's mState variable works.
624
624
MOZ_ASSERT (mChecker .IsWritable ());
625
625
626
- MOZ_ASSERT (mEntryStore .Get ());
626
+ MOZ_ASSERT (mEntryStore .IsAllocated ());
627
627
628
628
MOZ_ASSERT (aSlot.IsLive ());
629
629
0 commit comments