MCPcopy Index your code
hub / github.com/nodejs/node / SharedDataAccess

Class SharedDataAccess

deps/v8/tools/stats-viewer.py:303–327  ·  view source on GitHub ↗

A utility class for reading data from the memory-mapped binary counters file.

Source from the content-addressed store, hash-verified

301
302
303class SharedDataAccess(object):
304 """A utility class for reading data from the memory-mapped binary
305 counters file."""
306
307 def __init__(self, data):
308 """Create a new instance.
309
310 Args:
311 data: A handle to the memory-mapped file, as returned by mmap.mmap.
312 """
313 self.data = data
314
315 def ByteAt(self, index):
316 """Return the (unsigned) byte at the specified byte index."""
317 return ord(self.CharAt(index))
318
319 def IntAt(self, index):
320 """Return the little-endian 32-byte int at the specified byte index."""
321 word_str = self.data[index:index+4]
322 result, = struct.unpack("I", word_str)
323 return result
324
325 def CharAt(self, index):
326 """Return the ascii character at the specified byte index."""
327 return self.data[index]
328
329
330class Counter(object):

Callers 1

MountSharedDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…