From 9e40851eabe6d35eb150ee9be8b2e0a3bcf8a7cf Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Tue, 27 Nov 2001 23:53:18 +0000 Subject: [PATCH] ack! back these out, weren't meant to land git-svn-id: svn://10.0.0.236/trunk@109062 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/ds/nsFixedSizeAllocator.h | 6 +----- mozilla/xpcom/ds/nsHashtable.cpp | 22 ++-------------------- mozilla/xpcom/ds/nsHashtable.h | 8 +------- 3 files changed, 4 insertions(+), 32 deletions(-) diff --git a/mozilla/xpcom/ds/nsFixedSizeAllocator.h b/mozilla/xpcom/ds/nsFixedSizeAllocator.h index 248d660ccfe..a9424da7da6 100644 --- a/mozilla/xpcom/ds/nsFixedSizeAllocator.h +++ b/mozilla/xpcom/ds/nsFixedSizeAllocator.h @@ -156,13 +156,9 @@ protected: FindBucket(size_t aSize); public: - nsFixedSizeAllocator() : mBuckets(nsnull) - { - MOZ_COUNT_CTOR(nsFixedSizeAllocator); - } + nsFixedSizeAllocator() : mBuckets(nsnull) {} ~nsFixedSizeAllocator() { - MOZ_COUNT_DTOR(nsFixedSizeAllocator); if (mBuckets) PL_FinishArenaPool(&mPool); } diff --git a/mozilla/xpcom/ds/nsHashtable.cpp b/mozilla/xpcom/ds/nsHashtable.cpp index e18e409f188..e36e8997560 100644 --- a/mozilla/xpcom/ds/nsHashtable.cpp +++ b/mozilla/xpcom/ds/nsHashtable.cpp @@ -37,7 +37,6 @@ #include "nsReadableUtils.h" #include "nsIObjectInputStream.h" #include "nsIObjectOutputStream.h" -#include "plarena.h" //////////////////////////////////////////////////////////////////////////////// // These functions really should be part of nspr, and have internal knowledge @@ -165,10 +164,6 @@ static void PR_CALLBACK _hashFreeTable(void *pool, void *item) { } static PLHashEntry * PR_CALLBACK _hashAllocEntry(void *pool, const void *key) { - if (pool) { - return (PLHashEntry*)((nsFixedSizeAllocator*)pool)->Alloc(sizeof(PLHashEntry)); - } - return PR_NEW(PLHashEntry); } @@ -177,11 +172,7 @@ static void PR_CALLBACK _hashFreeEntry(void *pool, PLHashEntry *entry, { if (flag == HT_FREE_ENTRY) { delete (nsHashKey *) (entry->key); - if (pool) { - ((nsFixedSizeAllocator*)pool)->Free((void*)entry, sizeof(PLHashEntry)); - } - else - PR_DELETE(entry); + PR_DELETE(entry); } } @@ -229,22 +220,13 @@ nsHashtable::nsHashtable(PRUint32 aInitSize, PRBool threadSafe) : mLock(NULL), mEnumerating(PR_FALSE) { MOZ_COUNT_CTOR(nsHashtable); - - static const size_t kBucketSizes[] = - { sizeof(PLHashEntry) }; - static const PRInt32 kNumBucketSizes = - sizeof(kBucketSizes) / sizeof(size_t); - - mPool.Init("hashFoo", kBucketSizes, kNumBucketSizes, - sizeof(PLHashEntry)*aInitSize); - PRStatus status = PL_HashTableInit(&mHashtable, aInitSize, _hashValue, _hashKeyCompare, _hashValueCompare, &_hashAllocOps, - (void*)&mPool); + NULL); PR_ASSERT(status == PR_SUCCESS); if (threadSafe) { mLock = PR_NewLock(); diff --git a/mozilla/xpcom/ds/nsHashtable.h b/mozilla/xpcom/ds/nsHashtable.h index 398e95ec93b..215522f32e4 100644 --- a/mozilla/xpcom/ds/nsHashtable.h +++ b/mozilla/xpcom/ds/nsHashtable.h @@ -49,13 +49,7 @@ class nsStringKey; class NS_COM nsHashKey { protected: - nsHashKey(void) { -#ifdef DEBUG - mKeyType = UnknownKey; -#endif - MOZ_COUNT_CTOR(nsHashKey); - } - + nsHashKey(void); public: virtual ~nsHashKey(void);