MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _environ_size

Function _environ_size

pre_commit/xargs.py:41–46  ·  view source on GitHub ↗
(_env: MutableMapping[str, str] | None = None)

Source from the content-addressed store, hash-verified

39
40
41def _environ_size(_env: MutableMapping[str, str] | None = None) -> int:
42 environ = _env if _env is not None else getattr(os, 'environb', os.environ)
43 size = 8 * len(environ) # number of pointers in `envp`
44 for k, v in environ.items():
45 size += len(k) + len(v) + 2 # c strings in `envp`
46 return size
47
48
49def _get_platform_max_length() -> int: # pragma: no cover (platform specific)

Callers 1

_get_platform_max_lengthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected