1. 25 Nis, 2018 1 kayıt (commit)
  2. 29 Ock, 2018 1 kayıt (commit)
  3. 16 Ara, 2017 1 kayıt (commit)
    • Benjamin Peterson's avatar
      fix up signedness in PyImport_ExtendInittab (#4831) · 0c644fcd
      Benjamin Peterson yazdı
      As a result of 92a3c6f4, the compiler complains:
      
      Python/import.c:2311:21: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
          if ((i + n + 1) <= PY_SSIZE_T_MAX / sizeof(struct _inittab)) {
               ~~~~~~~~~  ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This overflow is extremely unlikely to happen, but let's avoid undefined
      behavior anyway.
      0c644fcd
  4. 12 Ara, 2017 1 kayıt (commit)
    • Victor Stinner's avatar
      import.c: Fix a GCC warning (#4822) · d233796f
      Victor Stinner yazdı
      Fix the warning:
      
      Python/import.c: warning: comparison between signed and unsigned integer expressions
           if ((i + n + 1) <= PY_SSIZE_T_MAX / sizeof(struct _inittab)) {
      d233796f
  5. 09 Ara, 2017 2 kayıt (commit)
    • Benjamin Peterson's avatar
      83620773
    • Benjamin Peterson's avatar
      closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575) · 42aa93b8
      Benjamin Peterson yazdı
      Python now supports checking bytecode cache up-to-dateness with a hash of the
      source contents rather than volatile source metadata. See the PEP for details.
      
      While a fairly straightforward idea, quite a lot of code had to be modified due
      to the pervasiveness of pyc implementation details in the codebase. Changes in
      this commit include:
      
      - The core changes to importlib to understand how to read, validate, and
        regenerate hash-based pycs.
      
      - Support for generating hash-based pycs in py_compile and compileall.
      
      - Modifications to our siphash implementation to support passing a custom
        key. We then expose it to importlib through _imp.
      
      - Updates to all places in the interpreter, standard library, and tests that
        manually generate or parse pyc files to grok the new format.
      
      - Support in the interpreter command line code for long options like
        --check-hash-based-pycs.
      
      - Tests and documentation for all of the above.
      42aa93b8
  6. 08 Ara, 2017 1 kayıt (commit)
  7. 06 Ara, 2017 2 kayıt (commit)
    • Victor Stinner's avatar
      bpo-32030: Add _PyImport_Fini2() (#4737) · 92a3c6f4
      Victor Stinner yazdı
      PyImport_ExtendInittab() now uses PyMem_RawRealloc() rather than
      PyMem_Realloc(). PyImport_ExtendInittab() can be called before
      Py_Initialize() whereas only the PyMem_Raw allocator is supposed to
      be used before Py_Initialize().
      
      Add _PyImport_Fini2() to release the memory allocated by
      PyImport_ExtendInittab() at exit. PyImport_ExtendInittab() now forces
      the usage of the default raw allocator, to be able to release memory
      in _PyImport_Fini2().
      
      Don't export these functions anymore to be C API, only to
      Py_BUILD_CORE:
      
      * _PyExc_Fini()
      * _PyImport_Fini()
      * _PyGC_DumpShutdownStats()
      * _PyGC_Fini()
      * _PyType_Fini()
      * _Py_HashRandomization_Fini()
      92a3c6f4
    • Victor Stinner's avatar
      bpo-32030: pass interp to _PyImport_Init() (#4736) · 672b6baa
      Victor Stinner yazdı
      Remove also the initstr variable, unused since the commit
      e69f0df4 pushed in 2012: "bpo-13959:
      Re-implement imp.find_module() in Lib/imp.py"
      672b6baa
  8. 03 Ara, 2017 1 kayıt (commit)
    • Neil Schemenauer's avatar
      Refactor PyImport_ImportModuleLevelObject(). (#4680) · eea3cc1e
      Neil Schemenauer yazdı
      Add import_find_and_load() helper function.  The addition of
      the importtime option has made PyImport_ImportModuleLevelObject() large
      and so using a helper seems worthwhile.  It also makes it clearer that
      abs_name is the only argument needed by _find_and_load().
      eea3cc1e
  9. 21 Kas, 2017 1 kayıt (commit)
  10. 16 Kas, 2017 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-32030: Enhance Py_Main() (#4412) · a7368ac6
      Victor Stinner yazdı
      Parse more env vars in Py_Main():
      
      * Add more options to _PyCoreConfig:
      
        * faulthandler
        * tracemalloc
        * importtime
      
      * Move code to parse environment variables from _Py_InitializeCore()
        to Py_Main(). This change fixes a regression from Python 3.6:
        PYTHONUNBUFFERED is now read before calling pymain_init_stdio().
      * _PyFaulthandler_Init() and _PyTraceMalloc_Init() now take an
        argument to decide if the module has to be enabled at startup.
      * tracemalloc_start() is now responsible to check the maximum number
        of frames.
      
      Other changes:
      
      * Cleanup Py_Main():
      
        * Rename some pymain_xxx() subfunctions
        * Add pymain_run_python() subfunction
      
      * Cleanup Py_NewInterpreter()
      * _PyInterpreterState_Enable() now reports failure
      * init_hash_secret() now considers pyurandom() failure as an "user
        error": don't fail with abort().
      * pymain_optlist_append() and pymain_strdup() now sets err on memory
        allocation failure.
      a7368ac6
  11. 15 Kas, 2017 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-32030: Split Py_Main() into subfunctions (#4399) · f7e5b56c
      Victor Stinner yazdı
      * Don't use "Python runtime" anymore to parse command line options or
        to get environment variables: pymain_init() is now a strict
        separation.
      * Use an error message rather than "crashing" directly with
        Py_FatalError(). Limit the number of calls to Py_FatalError(). It
        prepares the code to handle errors more nicely later.
      * Warnings options (-W, PYTHONWARNINGS) and "XOptions" (-X) are now
        only added to the sys module once Python core is properly
        initialized.
      * _PyMain is now the well identified owner of some important strings
        like: warnings options, XOptions, and the "program name". The
        program name string is now properly freed at exit.
        pymain_free() is now responsible to free the "command" string.
      * Rename most methods in Modules/main.c to use a "pymain_" prefix to
        avoid conflits and ease debug.
      * Replace _Py_CommandLineDetails_INIT with memset(0)
      * Reorder a lot of code to fix the initialization ordering. For
        example, initializing standard streams now comes before parsing
        PYTHONWARNINGS.
      * Py_Main() now handles errors when adding warnings options and
        XOptions.
      * Add _PyMem_GetDefaultRawAllocator() private function.
      * Cleanup _PyMem_Initialize(): remove useless global constants: move
        them into _PyMem_Initialize().
      * Call _PyRuntime_Initialize() as soon as possible:
        _PyRuntime_Initialize() now returns an error message on failure.
      * Add _PyInitError structure and following macros:
      
        * _Py_INIT_OK()
        * _Py_INIT_ERR(msg)
        * _Py_INIT_USER_ERR(msg): "user" error, don't abort() in that case
        * _Py_INIT_FAILED(err)
      f7e5b56c
  12. 07 Kas, 2017 1 kayıt (commit)
  13. 02 Kas, 2017 1 kayıt (commit)
  14. 16 Eki, 2017 1 kayıt (commit)
    • Victor Stinner's avatar
      bpo-31773: _PyTime_GetPerfCounter() uses _PyTime_t (GH-3983) · bdaeb7d2
      Victor Stinner yazdı
      * Rewrite win_perf_counter() to only use integers internally.
      * Add _PyTime_MulDiv() which compute "ticks * mul / div"
        in two parts (int part and remaining) to prevent integer overflow.
      * Clock frequency is checked at initialization for integer overflow.
      * Enhance also pymonotonic() to reduce the precision loss on macOS
        (mach_absolute_time() clock).
      bdaeb7d2
  15. 12 Eki, 2017 1 kayıt (commit)
  16. 10 Eki, 2017 1 kayıt (commit)
  17. 03 Eki, 2017 1 kayıt (commit)
  18. 29 Eyl, 2017 1 kayıt (commit)
  19. 15 Eyl, 2017 1 kayıt (commit)
    • Eric Snow's avatar
      bpo-28411: Support other mappings in PyInterpreterState.modules. (#3593) · 3f9eee6e
      Eric Snow yazdı
      The concrete PyDict_* API is used to interact with PyInterpreterState.modules in a number of places. This isn't compatible with all dict subclasses, nor with other Mapping implementations. This patch switches the concrete API usage to the corresponding abstract API calls.
      
      We also add a PyImport_GetModule() function (and some other helpers) to reduce a bunch of code duplication.
      3f9eee6e
  20. 14 Eyl, 2017 2 kayıt (commit)
    • Eric Snow's avatar
      bpo-28411: Isolate PyInterpreterState.modules (#3575) · d393c1b2
      Eric Snow yazdı
      A bunch of code currently uses PyInterpreterState.modules directly instead of PyImport_GetModuleDict(). This complicates efforts to make changes relative to sys.modules. This patch switches to using PyImport_GetModuleDict() uniformly. Also, a number of related uses of sys.modules are updated for uniformity for the same reason.
      
      Note that this code was already reviewed and merged as part of #1638. I reverted that and am now splitting it up into more focused parts.
      d393c1b2
    • Eric Snow's avatar
      bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565) · 93c92f7d
      Eric Snow yazdı
      PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
      93c92f7d
  21. 08 Eyl, 2017 1 kayıt (commit)
    • Eric Snow's avatar
      bpo-30860: Consolidate stateful runtime globals. (#3397) · 2ebc5ce4
      Eric Snow yazdı
      * group the (stateful) runtime globals into various topical structs
      * consolidate the topical structs under a single top-level _PyRuntimeState struct
      * add a check-c-globals.py script that helps identify runtime globals
      
      Other globals are excluded (see globals.txt and check-c-globals.py).
      2ebc5ce4
  22. 07 Eyl, 2017 1 kayıt (commit)
  23. 04 Eyl, 2017 1 kayıt (commit)
  24. 12 Tem, 2017 1 kayıt (commit)
  25. 10 Tem, 2017 1 kayıt (commit)
  26. 06 Tem, 2017 1 kayıt (commit)
  27. 15 Haz, 2017 1 kayıt (commit)
  28. 28 May, 2017 1 kayıt (commit)
  29. 23 Mar, 2017 1 kayıt (commit)
    • Serhiy Storchaka's avatar
      bpo-6532: Make the thread id an unsigned integer. (#781) · aefa7ebf
      Serhiy Storchaka yazdı
      * bpo-6532: Make the thread id an unsigned integer.
      
      From C API side the type of results of PyThread_start_new_thread() and
      PyThread_get_thread_ident(), the id parameter of
      PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState
      changed from "long" to "unsigned long".
      
      * Restore a check in thread_get_ident().
      aefa7ebf
  30. 08 Mar, 2017 1 kayıt (commit)
  31. 04 Şub, 2017 1 kayıt (commit)
  32. 23 Ock, 2017 1 kayıt (commit)
  33. 09 Ara, 2016 1 kayıt (commit)
    • Victor Stinner's avatar
      Use _PyObject_CallMethodIdObjArgs() · 55ba38a4
      Victor Stinner yazdı
      Issue #28915: Replace _PyObject_CallMethodId() with
      _PyObject_CallMethodIdObjArgs() in various modules when the format string was
      only made of "O" formats, PyObject* arguments.
      
      _PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and
      doesn't have to parse a format string.
      55ba38a4
  34. 04 Ara, 2016 1 kayıt (commit)
    • Victor Stinner's avatar
      Backed out changeset b9c9691c72c5 · de4ae3d4
      Victor Stinner yazdı
      Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like
      _PyObject_CallArg1() uses more stack memory than
      PyObject_CallFunctionObjArgs().
      de4ae3d4
  35. 01 Ara, 2016 1 kayıt (commit)
    • Victor Stinner's avatar
      Replace PyObject_CallFunctionObjArgs() with fastcall · 27580c1f
      Victor Stinner yazdı
      * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func)
      * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg)
      
      PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires
      extra work to "parse" C arguments to build a C array of PyObject*.
      
      _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
      memory on the C stack.
      
      This change is part of the fastcall project. The change on listsort() is
      related to the issue #23507.
      27580c1f
  36. 20 Kas, 2016 1 kayıt (commit)
  37. 16 Kas, 2016 1 kayıt (commit)