Bug 1246013 (part 1) - Store a copy of the ETLDEntry directly in DomainEntry instead of a pointer to it. r=jduell.

This reduces the size of nsEffectiveTLDService from 256 KiB to 128 KiB on
64-bit platforms.
This commit is contained in:
Nicholas Nethercote 2016-02-05 11:17:35 +11:00
parent 2c7fcb4d59
commit e25ba5a78a
2 changed files with 7 additions and 7 deletions

View File

@ -90,7 +90,7 @@ nsEffectiveTLDService::Init()
#endif
nsDomainEntry *entry = mHash.PutEntry(domain);
NS_ENSURE_TRUE(entry, NS_ERROR_OUT_OF_MEMORY);
entry->SetData(&entries[i]);
entry->SetData(entries[i]);
}
MOZ_ASSERT(!gService);

View File

@ -53,7 +53,7 @@ public:
KeyType GetKey() const
{
return GetEffectiveTLDName(mData->strtab_index);
return GetEffectiveTLDName(mData.strtab_index);
}
bool KeyEquals(KeyTypePointer aKey) const
@ -75,11 +75,11 @@ public:
enum { ALLOW_MEMMOVE = true };
void SetData(const ETLDEntry* entry) { mData = entry; }
void SetData(ETLDEntry entry) { mData = entry; }
bool IsNormal() { return mData->wild || !mData->exception; }
bool IsException() { return mData->exception; }
bool IsWild() { return mData->wild; }
bool IsNormal() { return mData.wild || !mData.exception; }
bool IsException() { return mData.exception; }
bool IsWild() { return mData.wild; }
static const char *GetEffectiveTLDName(size_t idx)
{
@ -87,7 +87,7 @@ public:
}
private:
const ETLDEntry* mData;
ETLDEntry mData;
#define ETLD_STR_NUM_1(line) str##line
#define ETLD_STR_NUM(line) ETLD_STR_NUM_1(line)
struct etld_string_list {