summaryrefslogtreecommitdiff
path: root/indra/llcommon/llmemory.h
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-01-06 12:36:44 -0700
committerXiaohong Bao <bao@lindenlab.com>2011-01-06 12:36:44 -0700
commitf4a8027feb2bbeafe7b0cfb3b05fd27f3cf243d3 (patch)
treede3c01f9df4a723267798bc7ad90dc8d6b444033 /indra/llcommon/llmemory.h
parent5654abd50d834c3a7d0efb5dde393ff34f09be17 (diff)
removed some debug code, redesigned the hash function, fixed bugs
Diffstat (limited to 'indra/llcommon/llmemory.h')
-rw-r--r--indra/llcommon/llmemory.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index f0e26d6b2f..f7ca33a279 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -173,9 +173,6 @@ public:
U16 mBlockLevels;
U16 mPartitionLevels;
- //debug use
- std::set<LLMemoryBlock*> mActiveBlockList ;
-
public:
//form a linked list
LLMemoryChunk* mNext ;
@@ -200,9 +197,13 @@ private:
S32 getChunkIndex(U32 size) ;
LLMemoryChunk* addChunk(S32 chunk_index) ;
void checkSize(U32 asked_size) ;
- void removeChunk(LLMemoryChunk* chunk, U16 key) ;
+ void removeChunk(LLMemoryChunk* chunk) ;
U16 findHashKey(const char* addr);
- LLMemoryChunk* findChunk(const char* addr, U16& key) ;
+ void addToHashTable(LLMemoryChunk* chunk) ;
+ void removeFromHashTable(LLMemoryChunk* chunk) ;
+ void rehash() ;
+ LLMemoryChunk* findChunk(const char* addr) ;
+
void destroyPool() ;
public:
@@ -222,6 +223,7 @@ private:
LLMemoryChunk* mChunkList[SUPER_ALLOCATION] ; //all memory chunks reserved by this pool, sorted by address
std::vector<LLMemoryChunk*> mChunkHashList ;
U16 mNumOfChunks ;
+ U16 mHashFactor ;
};
//
@@ -245,6 +247,7 @@ private:
void fragmentationtest() ;
void test(U32 min_size, U32 max_size, U32 stride, U32 times, bool random_deletion, bool output_statistics) ;
+ void testAndTime(U32 size, U32 times) ;
public:
void* operator new(size_t size)