summaryrefslogtreecommitdiffstats
path: root/Python/hamt.c
Commit message (Collapse)AuthorAgeFilesLines
* gh-99537: Use Py_SETREF() function in C code (#99657)Victor Stinner2022-11-221-2/+1
| | | | | | | | | | | | | | | Fix potential race condition in code patterns: * Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);" * Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);" * Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);" Other changes: * Replace "old = var; var = new; Py_DECREF(var)" with "Py_SETREF(var, new);" * Replace "old = var; var = new; Py_XDECREF(var)" with "Py_XSETREF(var, new);" * And remove the "old" variable.
* gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)Victor Stinner2022-11-161-2/+1
| | | | Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
* gh-81057: Move contextvars-related Globals to _PyRuntimeState (gh-99400)Eric Snow2022-11-161-54/+32
| | | | | This is part of the effort to consolidate global variables, to make them easier to manage (and make it easier to later move some of them to PyInterpreterState). https://github.com/python/cpython/issues/81057
* gh-99300: Use Py_NewRef() in Python/ directory (#99317)Victor Stinner2022-11-101-94/+47
| | | | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Python/ directory. Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* GH-93207: Remove HAVE_STDARG_PROTOTYPES configure check for stdarg.h (#93215)Kumar Aditya2022-05-271-4/+0
|
* gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066)Yury Selivanov2022-05-231-3/+11
| | | | | | | Also while there, clarify a few things about why we reduce the hash to 32 bits. Co-authored-by: Eli Libman <eli@hyro.ai> Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)Victor Stinner2022-03-311-9/+9
| | | Use the macro in C files of the Python/ directory.
* bpo-46417: Clear more static types (GH-30796)Victor Stinner2022-01-221-21/+0
| | | | | | | * Move PyContext static types into object.c static_types list. * Rename PyContextTokenMissing_Type to _PyContextTokenMissing_Type and declare it in pycore_context.h. * _PyHamtItems types are no long exported: replace PyAPI_DATA() with extern.
* bpo-46008: Make runtime-global object/type lifecycle functions and state ↵Eric Snow2021-12-091-5/+10
| | | | | | | | | | | | consistent. (gh-29998) This change is strictly renames and moving code around. It helps in the following ways: * ensures type-related init functions focus strictly on one of the three aspects (state, objects, types) * passes in PyInterpreterState * to all those functions, simplifying work on moving types/objects/state to the interpreter * consistent naming conventions help make what's going on more clear * keeping API related to a type in the corresponding header file makes it more obvious where to look for it https://bugs.python.org/issue46008
* bpo-29882: Add _Py_popcount32() function (GH-20518)Victor Stinner2020-06-081-22/+3
| | | | | | * Rename pycore_byteswap.h to pycore_bitutils.h. * Move popcount_digit() to pycore_bitutils.h as _Py_popcount32(). * _Py_popcount32() uses GCC and clang builtin function if available. * Add unit tests to _Py_popcount32().
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-2/+2
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* bpo-40268: Remove a few pycore_pystate.h includes (GH-19510)Victor Stinner2020-04-141-2/+1
|
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-3/+3
|
* bpo-39573: Use Py_SET_SIZE() function (GH-18402)Victor Stinner2020-02-071-2/+2
| | | | Replace direct acccess to PyVarObject.ob_size with usage of the Py_SET_SIZE() function.
* closes bpo-37446: resolve undefined behavior in Python/hamt.c (GH-17727)Batuhan Taşkaya2019-12-311-1/+1
|
* Typo fix - implemention should be implementation (GH-16806)Hansraj Das2019-10-151-1/+1
|
* Fix typos in comments, docs and test names (#15018)Min ho Kim2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Update posixmodule checksum. * Reverse idlelib changes.
* bpo-35983: skip trashcan for subclasses (GH-11841)Jeroen Demeyer2019-05-101-6/+6
| | | | | Add new trashcan macros to deal with a double deallocation that could occur when the `tp_dealloc` of a subclass calls the `tp_dealloc` of a base class and that base class uses the trashcan mechanism. Patch by Jeroen Demeyer.
* bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)Serhiy Storchaka2019-03-131-1/+1
|
* bpo-35059: Cast void* to PyObject* (GH-10650)Victor Stinner2018-11-221-3/+4
| | | Don't pass void* to Python macros: use _PyObject_CAST().
* bpo-35081: Add Include/internal/pycore_object.h (GH-10640)Victor Stinner2018-11-211-2/+3
| | | | Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
* bpo-35081: Rename internal headers (GH-10275)Victor Stinner2018-11-121-1/+1
| | | | | | | | | | | | | | Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
* bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner2018-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | * Rename Include/internal/ header files: * pyatomic.h -> pycore_atomic.h * ceval.h -> pycore_ceval.h * condvar.h -> pycore_condvar.h * context.h -> pycore_context.h * pygetopt.h -> pycore_getopt.h * gil.h -> pycore_gil.h * hamt.h -> pycore_hamt.h * hash.h -> pycore_hash.h * mem.h -> pycore_mem.h * pystate.h -> pycore_state.h * warnings.h -> pycore_warnings.h * PCbuild project, Makefile.pre.in, Modules/Setup: add the Include/internal/ directory to the search paths of header files. * Update includes. For example, replace #include "internal/mem.h" with #include "pycore_mem.h".
* Fix GCC warning in Python/hamt.c (GH-7618)Zackery Spytz2018-07-061-1/+1
|
* bpo-33803: Fix a crash in hamt.c (#7504)Yury Selivanov2018-06-081-0/+2
|
* Spelling fixes to docs, docstrings, and comments (GH-6374)Ville Skyttä2018-04-201-2/+2
|
* Add two missing error checks in hamt.c (GH-5851)Xiang Zhang2018-03-081-1/+7
|
* Fix some warnings produced by different compilers. (#5593)Serhiy Storchaka2018-02-091-2/+2
|
* bpo-32436: Fix compiler warning (#5483)Yury Selivanov2018-02-021-0/+2
|
* Fix typo in hamt.c comments (#5478)Dmitry Alimov2018-02-021-1/+1
|
* bpo-32707: Fix warnings in hamt.c (#5430)Yury Selivanov2018-01-291-3/+5
|
* bpo-32436: Fix a refleak; var GC tracking; a GCC warning (#5326)Yury Selivanov2018-01-251-1/+1
| | | | | The refleak in question wasn't really important, as context vars are usually created at the toplevel and live as long as the interpreter lives, so the context var name isn't ever GCed anyways.
* Fix 3rd level node's binary representation in HAMT algorithm description (#5319)Dmitry Alimov2018-01-251-1/+1
|
* bpo-32436: Don't use native popcount() (also fixes bpo-32641) (#5292)Yury Selivanov2018-01-241-14/+12
|
* bpo-32436: Fix potential NULL dereference (#5286)Yury Selivanov2018-01-231-0/+4
|
* bpo-32436: Remove a redundant assert (#5275)Yury Selivanov2018-01-231-1/+0
|
* bpo-32436: Implement PEP 567 (#5027)Yury Selivanov2018-01-231-0/+2982