mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Add profiling to StringTable.
This commit is contained in:
parent
e9308e40ed
commit
40b871e652
1 changed files with 7 additions and 0 deletions
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "core/strings/stringFunctions.h"
|
#include "core/strings/stringFunctions.h"
|
||||||
#include "core/stringTable.h"
|
#include "core/stringTable.h"
|
||||||
|
#include "platform/profiler.h"
|
||||||
|
|
||||||
_StringTable *_gStringTable = NULL;
|
_StringTable *_gStringTable = NULL;
|
||||||
const U32 _StringTable::csm_stInitSize = 29;
|
const U32 _StringTable::csm_stInitSize = 29;
|
||||||
|
|
@ -121,6 +122,8 @@ void _StringTable::destroy()
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
StringTableEntry _StringTable::insert(const char* _val, const bool caseSens)
|
StringTableEntry _StringTable::insert(const char* _val, const bool caseSens)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(StringTableInsert);
|
||||||
|
|
||||||
// Added 3/29/2007 -- If this is undesirable behavior, let me know -patw
|
// Added 3/29/2007 -- If this is undesirable behavior, let me know -patw
|
||||||
const char *val = _val;
|
const char *val = _val;
|
||||||
if( val == NULL )
|
if( val == NULL )
|
||||||
|
|
@ -165,6 +168,8 @@ StringTableEntry _StringTable::insertn(const char* src, S32 len, const bool cas
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
StringTableEntry _StringTable::lookup(const char* val, const bool caseSens)
|
StringTableEntry _StringTable::lookup(const char* val, const bool caseSens)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(StringTableLookup);
|
||||||
|
|
||||||
Node **walk, *temp;
|
Node **walk, *temp;
|
||||||
U32 key = hashString(val);
|
U32 key = hashString(val);
|
||||||
walk = &buckets[key % numBuckets];
|
walk = &buckets[key % numBuckets];
|
||||||
|
|
@ -181,6 +186,8 @@ StringTableEntry _StringTable::lookup(const char* val, const bool caseSens)
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
StringTableEntry _StringTable::lookupn(const char* val, S32 len, const bool caseSens)
|
StringTableEntry _StringTable::lookupn(const char* val, S32 len, const bool caseSens)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(StringTableLookupN);
|
||||||
|
|
||||||
Node **walk, *temp;
|
Node **walk, *temp;
|
||||||
U32 key = hashStringn(val, len);
|
U32 key = hashStringn(val, len);
|
||||||
walk = &buckets[key % numBuckets];
|
walk = &buckets[key % numBuckets];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue