You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (b = m_sockets[hash]; b; b = b->m_nextInSocket)
175
174
{
176
-
if (strcmp(nameString, b->m_nameString.str()) == 0)
175
+
if (strcmp(name, b->m_nameString.str()) == 0)
177
176
return b->m_key;
178
177
}
179
178
180
179
// nope, guess not. let's allocate it.
181
-
b = newInstance(Bucket);
182
-
b->m_key = (NameKeyType)m_nextID++;
183
-
b->m_nameString = nameString;
184
-
b->m_nextInSocket = m_sockets[hash];
185
-
m_sockets[hash] = b;
186
-
187
-
NameKeyType result = b->m_key;
188
-
189
-
#if defined(RTS_DEBUG)
190
-
// reality-check to be sure our hasher isn't going bad.
191
-
const Int maxThresh = 3;
192
-
Int numOverThresh = 0;
193
-
for (Int i = 0; i < SOCKET_COUNT; ++i)
194
-
{
195
-
Int numInThisSocket = 0;
196
-
for (b = m_sockets[i]; b; b = b->m_nextInSocket)
197
-
++numInThisSocket;
198
-
199
-
if (numInThisSocket > maxThresh)
200
-
++numOverThresh;
201
-
}
202
-
203
-
// if more than a small percent of the sockets are getting deep, probably want to increase the socket count.
204
-
if (numOverThresh > SOCKET_COUNT/20)
205
-
{
206
-
DEBUG_CRASH(("hmm, might need to increase the number of bucket-sockets for NameKeyGenerator (numOverThresh %d = %f%%)",numOverThresh,(Real)numOverThresh/(Real)(SOCKET_COUNT/20)));
0 commit comments