зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1269451 - Part 3: Stop doing DEBUG-only hashing to catch incorrect mutations to SharedImmutableString's chars; r=jimb
DEBUG tests keep timing out with these enabled.
This commit is contained in:
Родитель
728d4fed84
Коммит
3bb22ebfcb
|
@ -14,9 +14,6 @@ SharedImmutableString::SharedImmutableString(SharedImmutableStringsCache&& cache
|
|||
SharedImmutableStringsCache::StringBox* box)
|
||||
: cache_(mozilla::Move(cache))
|
||||
, box_(box)
|
||||
#ifdef DEBUG
|
||||
, hash_(mozilla::HashString(box->chars(), box->length()))
|
||||
#endif
|
||||
{
|
||||
MOZ_ASSERT(box);
|
||||
MOZ_ASSERT(box->refcount > 0);
|
||||
|
@ -25,14 +22,10 @@ SharedImmutableString::SharedImmutableString(SharedImmutableStringsCache&& cache
|
|||
SharedImmutableString::SharedImmutableString(SharedImmutableString&& rhs)
|
||||
: cache_(mozilla::Move(rhs.cache_))
|
||||
, box_(rhs.box_)
|
||||
#ifdef DEBUG
|
||||
, hash_(mozilla::HashString(box_->chars(), box_->length()))
|
||||
#endif
|
||||
{
|
||||
MOZ_ASSERT(this != &rhs, "self move not allowed");
|
||||
MOZ_ASSERT(rhs.box_);
|
||||
MOZ_ASSERT(rhs.box_->refcount > 0);
|
||||
MOZ_ASSERT(rhs.hash_ == hash_);
|
||||
|
||||
rhs.box_ = nullptr;
|
||||
}
|
||||
|
@ -74,8 +67,6 @@ SharedImmutableString::~SharedImmutableString() {
|
|||
if (!box_)
|
||||
return;
|
||||
|
||||
MOZ_ASSERT(mozilla::HashString(chars(), length()) == hash_);
|
||||
|
||||
auto locked = cache_.inner_->lock();
|
||||
|
||||
MOZ_ASSERT(box_->refcount > 0);
|
||||
|
|
|
@ -368,10 +368,6 @@ class SharedImmutableString
|
|||
mutable SharedImmutableStringsCache cache_;
|
||||
mutable SharedImmutableStringsCache::StringBox* box_;
|
||||
|
||||
#ifdef DEBUG
|
||||
HashNumber hash_;
|
||||
#endif
|
||||
|
||||
SharedImmutableString(SharedImmutableStringsCache&& cache,
|
||||
SharedImmutableStringsCache::StringBox* box);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче