MCPcopy Create free account
hub / github.com/python/cpython / _intern_string

Method _intern_string

Lib/profiling/sampling/gecko_collector.py:392–399  ·  view source on GitHub ↗

Intern a string in the global string table.

(self, s)

Source from the content-addressed store, hash-verified

390 return CATEGORY_PYTHON if self._is_python(filename) else CATEGORY_NATIVE
391
392 def _intern_string(self, s):
393 """Intern a string in the global string table."""
394 if s in self.global_string_map:
395 return self.global_string_map[s]
396 idx = len(self.global_strings)
397 self.global_strings.append(s)
398 self.global_string_map[s] = idx
399 return idx
400
401 def _add_marker(self, tid, name, start_time, end_time, category):
402 """Add an interval marker for a specific thread."""

Callers 4

_add_markerMethod · 0.95
_get_or_create_funcMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected