Brandt Bucher
33b671e724
bpo-38823: Fix refleak in marshal init error path (GH-17260)
6 years ago
Jeroen Demeyer
59ad110d7a
bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)
7 years ago
Pablo Galindo
4a2edc34a4
bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set PyCode_New as a compatibility wrapper (GH-13959)
Add PyCode_NewEx to be used internally and set PyCode_New as a compatibility wrapper
7 years ago
Pablo Galindo
8c77b8cb91
bpo-36540: PEP 570 -- Implementation (GH-12701)
This commit contains the implementation of PEP570: Python positional-only parameters.
* Update Grammar/Grammar with new typedarglist and varargslist
* Regenerate grammar files
* Update and regenerate AST related files
* Update code object
* Update marshal.c
* Update compiler and symtable
* Regenerate importlib files
* Update callable objects
* Implement positional-only args logic in ceval.c
* Regenerate frozen data
* Update standard library to account for positional-only args
* Add test file for positional-only args
* Update other test files to account for positional-only args
* Add News entry
* Update inspect module and related tests
7 years ago
Zackery Spytz
4c49da0cb7
bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015)
Set MemoryError when appropriate, add missing failure checks,
and fix some potential leaks.
7 years ago
Serhiy Storchaka
c5734998d9
bpo-33720: Refactor marshalling/unmarshalling floats. (GH-8071)
8 years ago
Steve Dower
2a4a62ba4a
bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)
8 years ago
Serhiy Storchaka
00987f6230
bpo-32011: Revert "Issue #15480 : Remove the deprecated and unused TYPE_INT64 code from marshal." ( #4381 )
Simplify the reverted code.
This reverts commit e9bbe8b87b .
8 years ago
Benjamin Peterson
c988ae01fe
remove current_filename optimization from marshal ( #3423 ) (closes bpo-31384)
8 years ago
Stefan Krah
f432a3234f
bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. ( #3157 )
8 years ago
Serhiy Storchaka
0767ad40bf
bpo-20185: Convert the marshal module to Argument Clinic. ( #541 )
Based on patch by Vajrasky Kok.
9 years ago
Serhiy Storchaka
c611a5b1d4
bpo-29746: Update marshal docs to Python 3. ( #547 )
9 years ago
Victor Stinner
55ba38a480
Use _PyObject_CallMethodIdObjArgs()
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.
9 years ago
Victor Stinner
4778eab1f2
Replace PyObject_CallFunction() with fastcall
Replace
PyObject_CallFunction(func, "O", arg)
and
PyObject_CallFunction(func, "O", arg, NULL)
with
_PyObject_CallArg1(func, arg)
Replace
PyObject_CallFunction(func, NULL)
with
_PyObject_CallNoArg(func)
_PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
memory on the C stack.
9 years ago
Christian Heimes
f051e43b22
Issue #28126 : Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
9 years ago
Victor Stinner
5dacbd4c42
Cleanup hashtable.h
Issue #26588 :
* Pass the hash table rather than the key size to hash and compare functions
* _Py_HASHTABLE_READ_KEY() and _Py_HASHTABLE_ENTRY_READ_KEY() macros now expect
the hash table as the first parameter, rather than the key size
* tracemalloc_get_traces_fill(): use _Py_HASHTABLE_ENTRY_READ_DATA() rather
than pointer dereference
* Remove the _Py_HASHTABLE_ENTRY_WRITE_PKEY() macro
* Move "PKEY" and "PDATA" macros inside hashtable.c
10 years ago
Victor Stinner
e8c6b2fd1b
Issue #26588 :
* _Py_HASHTABLE_ENTRY_DATA: change type from "char *" to "const void *"
* Add _Py_HASHTABLE_ENTRY_WRITE_PKEY() macro
* Rename _Py_HASHTABLE_ENTRY_WRITE_DATA() macro to
_Py_HASHTABLE_ENTRY_WRITE_PDATA()
* Add _Py_HASHTABLE_ENTRY_WRITE_DATA() macro
10 years ago
Victor Stinner
285cf0a601
hashtable.h now supports keys of any size
Issue #26588 : hashtable.h now supports keys of any size, not only
sizeof(void*). It allows to support key larger than sizeof(void*), but also to
use less memory for key smaller than sizeof(void*).
10 years ago
Victor Stinner
322bc12c31
Ooops, revert changeset ea9efa06c137
Change pushed by mistake, the patch is still under review :-/
"""
_tracemalloc: add domain to trace keys
* hashtable.h: key has now a variable size
* _tracemalloc uses (pointer: void*, domain: unsigned int) as key for traces
"""
10 years ago
Victor Stinner
51b846c47a
_tracemalloc: add domain to trace keys
* hashtable.h: key has now a variable size
* _tracemalloc uses (pointer: void*, domain: unsigned int) as key for traces
10 years ago
Victor Stinner
1aa78938b0
Issue #26146 : marshal.loads() now uses the empty frozenset singleton
10 years ago
Serhiy Storchaka
ef1585eb9a
Issue #25923 : Added more const qualifiers to signatures of static and private functions.
10 years ago
Serhiy Storchaka
225821c653
Issue #25899 : Converted non-ASCII characters in docstrings and manpage
to ASCII replacements. Original patch by Chris Angelico.
10 years ago
Victor Stinner
e134a7fe36
Issue #23752 : _Py_fstat() is now responsible to raise the Python exception
Add _Py_fstat_noraise() function when a Python exception is not welcome.
11 years ago
Victor Stinner
f329878e74
Issue #23753 : Python doesn't support anymore platforms without stat() or
fstat(), these functions are always required.
Remove HAVE_STAT and HAVE_FSTAT defines, and stop supporting DONT_HAVE_STAT and
DONT_HAVE_FSTAT.
11 years ago
Steve Dower
f2f373f593
Issue #23152 : Implement _Py_fstat() to support files larger than 2 GB on Windows.
fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
11 years ago
Serhiy Storchaka
26861b0b29
Issue #23450 : Fixed possible integer overflows.
11 years ago
Serhiy Storchaka
c07422c119
Splitted the WFILE structure to WFILE and RFILE.
11 years ago
Serhiy Storchaka
c1efe5f039
Issue #23344 : marshal.dumps() is now 20-25% faster on average.
11 years ago
Serhiy Storchaka
ce921c62cc
Issue #20416 : marshal.dumps() with protocols 3 and 4 is now 40-50% faster on
average.
11 years ago
Serhiy Storchaka
000daaee57
Fixed memory leak in marshal.
11 years ago
Serhiy Storchaka
b757c83ec6
Issue #22581 : Use more "bytes-like object" throughout the docs and comments.
11 years ago
Steve Dower
f6c69e6cc9
#22734 marshal needs a lower stack depth for debug builds on Windows
11 years ago
Victor Stinner
45e8e2f218
Issue #21490 : Add new C macros: Py_ABS() and Py_STRINGIFY()
Keep _Py_STRINGIZE() in PC/pyconfig.h to not introduce a dependency between
pyconfig.h and pymacros.h.
12 years ago
Victor Stinner
da062558db
Fix compiler warning (on Windows 64-bit): explicit cast Py_ssize_t to unsigned
char, n is in range [0; 255] (a tuple cannot have a negative length)
12 years ago
Victor Stinner
359fabc19f
Issue #19437 : Cleanup r_ref() of the marshal module
12 years ago
Victor Stinner
d5cae6f143
Issue #19437 : Fix r_object() of marshal module, handle PyDict_SetItem() failure
for TYPE_DICT and stop immedialty on first r_object() failure
12 years ago
Victor Stinner
b1b7b1834b
Issue #19437 : Fix r_object() of marshal module, handle r_byte() failure for
TYPE_SMALL_TUPLE
12 years ago
Victor Stinner
763b0d19c9
Issue #19437 : Fix r_PyLong() of marshal module, stop immediatly at first
failure, don't read any more data
12 years ago
Serhiy Storchaka
c679227e31
Issue #1772673 : The type of `char*` arguments now changed to `const char*`.
12 years ago
Antoine Pitrou
42c25f5581
Close #19260 : remove outdated comment in marshal.c
12 years ago
Kristján Valur Jónsson
0a7697b718
Catch a few extra error cases in marshal.c
12 years ago
Kristján Valur Jónsson
5983258bf2
Issue #19219 Remove a lot of "retval = NULL" statements, now that retval
is pre-initialized to that value. Test show a 5% speedup as a bonus.
12 years ago
Christian Heimes
3572842c19
Issue #19219 : retval may be used uninitialized value
CID 486239: Uninitialized pointer read (UNINIT)
12 years ago
Antoine Pitrou
b30f271299
Try to fix weird assertion error on the Fedora buildbot.
12 years ago
Antoine Pitrou
1164dfcb86
Issue #19219 : Speed up marshal.loads(), and make pyc files slightly (5% to 10%) smaller.
12 years ago
Serhiy Storchaka
9594942716
Issue #18783 : Removed existing mentions of Python long type in docstrings,
error messages and comments.
13 years ago
Antoine Pitrou
9ed5f27266
Issue #18722 : Remove uses of the "register" keyword in C code.
13 years ago
Serhiy Storchaka
3641a74e1c
Issue #17872 : Fix a segfault in marshal.load() when input stream returns
more bytes than requested.
13 years ago
Serhiy Storchaka
dfde2151ed
Fix reference leaks introduced by the patch for issue #5308 .
13 years ago