Skip to content

Commit

Permalink
Merge pull request #1089 from eightyeight/profile-stringtable
Browse files Browse the repository at this point in the history
Add profiler regions for StringTable functions
  • Loading branch information
LuisAntonRebollo committed Jan 25, 2015
2 parents c9a8187 + 40b871e commit 79df1a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Engine/source/core/stringTable.cpp
Expand Up @@ -22,6 +22,7 @@

#include "core/strings/stringFunctions.h"
#include "core/stringTable.h"
#include "platform/profiler.h"

_StringTable *_gStringTable = NULL;
const U32 _StringTable::csm_stInitSize = 29;
Expand Down Expand Up @@ -121,6 +122,8 @@ void _StringTable::destroy()
//--------------------------------------
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
const char *val = _val;
if( val == NULL )
Expand Down Expand Up @@ -165,6 +168,8 @@ StringTableEntry _StringTable::insertn(const char* src, S32 len, const bool cas
//--------------------------------------
StringTableEntry _StringTable::lookup(const char* val, const bool caseSens)
{
PROFILE_SCOPE(StringTableLookup);

Node **walk, *temp;
U32 key = hashString(val);
walk = &buckets[key % numBuckets];
Expand All @@ -181,6 +186,8 @@ StringTableEntry _StringTable::lookup(const char* val, const bool caseSens)
//--------------------------------------
StringTableEntry _StringTable::lookupn(const char* val, S32 len, const bool caseSens)
{
PROFILE_SCOPE(StringTableLookupN);

Node **walk, *temp;
U32 key = hashStringn(val, len);
walk = &buckets[key % numBuckets];
Expand Down

0 comments on commit 79df1a1

Please sign in to comment.