From e25ba5a78a476853a9712c05eb52862f93e00d4a Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 5 Feb 2016 11:17:35 +1100 Subject: [PATCH] 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. --- netwerk/dns/nsEffectiveTLDService.cpp | 2 +- netwerk/dns/nsEffectiveTLDService.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/netwerk/dns/nsEffectiveTLDService.cpp b/netwerk/dns/nsEffectiveTLDService.cpp index f8eb9c363b3..ef83ac9d42a 100644 --- a/netwerk/dns/nsEffectiveTLDService.cpp +++ b/netwerk/dns/nsEffectiveTLDService.cpp @@ -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); diff --git a/netwerk/dns/nsEffectiveTLDService.h b/netwerk/dns/nsEffectiveTLDService.h index 75e966c14f8..35fb1a42192 100644 --- a/netwerk/dns/nsEffectiveTLDService.h +++ b/netwerk/dns/nsEffectiveTLDService.h @@ -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 {