MCPcopy Create free account
hub / github.com/apache/trafficserver / toIndex

Method toIndex

src/records/RecHttp.cc:841–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

839}
840
841int
842SessionProtocolNameRegistry::toIndex(swoc::TextView name)
843{
844 int zret = this->indexFor(name);
845 if (INVALID == zret) {
846 if (m_n < MAX) {
847 // Localize the name by copying it in to the arena.
848 auto text = m_arena.alloc(name.size() + 1).rebind<char>();
849 memcpy(text, name);
850 text.end()[-1] = '\0';
851 m_names[m_n].assign(text.data(), name.size());
852 zret = m_n++;
853 } else {
854 ink_release_assert(!"Session protocol name registry overflow");
855 }
856 }
857 return zret;
858}
859
860int
861SessionProtocolNameRegistry::toIndexConst(TextView name)

Callers 2

markInMethod · 0.80

Calls 7

indexForMethod · 0.95
memcpyFunction · 0.50
allocMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45
assignMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected