mirror of
https://github.com/python/cpython.git
synced 2025-10-07 23:51:16 +00:00
gh-109595: Add -Xcpu_count=<n> cmdline for container users (#109667)
--------- Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
This commit is contained in:
parent
5aa62a8de1
commit
0362cbf908
15 changed files with 192 additions and 11 deletions
|
@ -2306,6 +2306,20 @@ sys__getframemodulename_impl(PyObject *module, int depth)
|
|||
return Py_NewRef(r);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
sys._get_cpu_count_config -> int
|
||||
|
||||
Private function for getting PyConfig.cpu_count
|
||||
[clinic start generated code]*/
|
||||
|
||||
static int
|
||||
sys__get_cpu_count_config_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=36611bb5efad16dc input=523e1ade2204084e]*/
|
||||
{
|
||||
const PyConfig *config = _Py_GetConfig();
|
||||
return config->cpu_count;
|
||||
}
|
||||
|
||||
static PerfMapState perf_map_state;
|
||||
|
||||
PyAPI_FUNC(int) PyUnstable_PerfMapState_Init(void) {
|
||||
|
@ -2440,6 +2454,7 @@ static PyMethodDef sys_methods[] = {
|
|||
SYS__STATS_CLEAR_METHODDEF
|
||||
SYS__STATS_DUMP_METHODDEF
|
||||
#endif
|
||||
SYS__GET_CPU_COUNT_CONFIG_METHODDEF
|
||||
{NULL, NULL} // sentinel
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue