Victor Stinner
7bfb42d5b7
Issue #28858 : Remove _PyObject_CallArg1() macro
...
Replace
_PyObject_CallArg1(func, arg)
with
PyObject_CallFunctionObjArgs(func, arg, NULL)
Using the _PyObject_CallArg1() macro increases the usage of the C stack, which
was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this
issue.
2016-12-05 17:04:32 +01:00
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.
2016-12-01 14:51:04 +01:00
Serhiy Storchaka
f0b311bd73
Issue #28123 : _PyDict_GetItem_KnownHash() now can raise an exception as
...
PyDict_GetItemWithError(). Patch by Xiang Zhang.
2016-11-06 13:18:24 +02:00
Raymond Hettinger
88057171f0
Revert part of 3471a3515827 that caused a performance regression
2016-09-11 22:45:53 -07:00
Victor Stinner
ad8c83ad6b
Avoid inefficient way to call functions without argument
...
Don't pass "()" format to PyObject_CallXXX() to call a function without
argument: pass NULL as the format string instead. It avoids to have to parse a
string to produce 0 argument.
2016-09-05 17:53:15 -07:00
doko@ubuntu.com
17f0e61891
- Modules/_collectionsmodule.c: Mark one more internal symbol as static.
2016-06-14 07:27:58 +02:00
doko@ubuntu.com
bc7315068f
- make some internal symbols static
2016-05-18 01:06:01 +02:00
Serhiy Storchaka
a0d416f0d1
Issue #26482 : Allowed pickling recursive dequeues.
2016-03-06 08:55:21 +02:00
Raymond Hettinger
d79d5b1a50
More logicial order. Move space saving step to just before it is used.
2016-03-04 09:55:07 -08:00
Raymond Hettinger
6f86a3308a
Factor-out common subexpression.
2016-03-02 00:30:58 -08:00
Raymond Hettinger
589106b206
Put block length computations in a more logical order.
2016-03-02 00:06:21 -08:00
Raymond Hettinger
38418662e0
Issue #26200 : The SETREF macro adds unnecessary work in some cases.
2016-02-08 20:34:49 -08:00
Raymond Hettinger
a63897164e
merge
2016-02-01 21:21:19 -08:00
Raymond Hettinger
0ef0423cb2
merge
2016-01-26 21:46:03 -08:00
Raymond Hettinger
3743432302
Issue #26194 : Fix undefined behavior for deque.insert() when len(d) == maxlen
2016-01-26 21:44:16 -08:00
Raymond Hettinger
306d6b1ea6
Convert another post-decrement while-loop to pre-decrement for consistency
...
and better generated code (on both GCC and CLang).
2016-01-24 12:40:42 -08:00
Raymond Hettinger
165eee214b
Convert two other post-decrement while-loops to pre-decrements for consistency
...
and for better code generation.
2016-01-24 11:32:07 -08:00
Raymond Hettinger
d84ec225bd
Miscellaneous refactorings
...
* Add comment to the maxlen structure entry about the meaning of maxlen == -1
* Factor-out code common to deque_append(left) and deque_extend(left)
* Factor inner-loop in deque_clear() to use only 1 test per loop instead of 2
* Tighten inner-loops for deque_item() and deque_ass_item() so that the
compiler can combine the decrement and test into a single step.
2016-01-24 09:12:06 -08:00
Benjamin Peterson
3e47a1337c
merge 3.5
2016-01-01 11:56:35 -06:00
Benjamin Peterson
4e3dd51396
merge 3.4
2016-01-01 11:56:16 -06:00
Benjamin Peterson
630329e4ea
merge 3.3
2016-01-01 11:55:47 -06:00
Benjamin Peterson
0e617e22f0
remove some copyright notices supserseded by the toplevel ones
2016-01-01 11:53:47 -06:00
Serhiy Storchaka
1ed017ae92
Issue #20440 : Cleaning up the code by using Py_SETREF and Py_CLEAR.
...
Old code is correct, but with Py_SETREF and Py_CLEAR it can be cleaner.
This patch doesn't fix bugs and hence there is no need to backport it.
2015-12-27 15:51:32 +02:00
Serhiy Storchaka
a9406e77fa
Issue #25421 : __sizeof__ methods of builtin types now use dynamic basic size.
...
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:07:11 +02:00
Serhiy Storchaka
5c4064e8bd
Issue #25421 : __sizeof__ methods of builtin types now use dynamic basic size.
...
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:05:25 +02:00
Raymond Hettinger
4a91d21381
Neaten-up the inner-loop logic.
2015-11-03 22:00:26 -05:00
Raymond Hettinger
df8f5b56c9
Minor cleanup.
2015-11-02 07:27:40 -05:00
Raymond Hettinger
0bdf9ea136
merge
2015-11-02 00:04:46 -05:00
Raymond Hettinger
67b97b8f8d
Move the initial start-search out of the main loop so it can be factored-out later.
2015-11-01 23:57:37 -05:00
Martin Panter
e56a919100
Issue #25523 : Merge a-to-an corrections from 3.5
2015-11-02 04:27:17 +00:00
Martin Panter
d2ad5718ad
Issue #25523 : Further a-to-an corrections new in 3.5
2015-11-02 04:20:33 +00:00
Raymond Hettinger
db41fd43cf
Removed unused parameter
2015-10-22 22:48:16 -07:00
Raymond Hettinger
0f43bb160e
Only update the state variable once per iteration.
2015-10-20 00:03:33 -07:00
Raymond Hettinger
20151f50f6
Issue #25414 : Remove unnecessary tests that can never succeed.
2015-10-16 22:47:29 -07:00
Raymond Hettinger
1eca237c2f
Remove old Todo entry that isn't going to happen.
2015-10-15 23:25:53 -07:00
Raymond Hettinger
a4b13d0020
Rewrap comment.
2015-10-15 08:05:31 -07:00
Raymond Hettinger
bc00341105
Use unsigned division
2015-10-14 23:33:23 -07:00
Raymond Hettinger
1286d14500
Improve variable names and constant expressions
2015-10-14 23:16:57 -07:00
Raymond Hettinger
965362e92d
Minor fixup. maxlen is already known.
2015-10-11 22:52:54 -07:00
Raymond Hettinger
d96db09b57
Refactor the deque trim logic to eliminate the two separate trim functions.
2015-10-11 22:34:48 -07:00
Raymond Hettinger
6b1e113f9f
Hoist the deque->maxlen lookup out of the inner-loop.
2015-10-11 09:43:50 -07:00
Raymond Hettinger
a7f63009d6
Minor tweak. Make the maxlen comparisons a little more clear and consistent.
2015-10-10 23:56:02 -04:00
Raymond Hettinger
848f2b595d
Backport early-out 91259f061cfb to reduce the cost of bb1a2944bcb6
2015-10-06 23:06:17 -04:00
Raymond Hettinger
0443ac2860
Eliminate unnecessary test
2015-10-05 22:52:37 -04:00
Raymond Hettinger
fd265f4a18
Factor out common iterator finalization code
2015-10-02 23:17:33 -07:00
Raymond Hettinger
0d30940dd2
Add fast paths to deque_init() for the common cases
2015-09-30 23:15:02 -07:00
Raymond Hettinger
38031143fb
Add an early-out for deque_clear()
2015-09-29 22:45:05 -07:00
Raymond Hettinger
8299e9b59e
Move the copy and clear functions upwards to eliminate unnecessary forward references.
2015-09-26 21:31:23 -07:00
Raymond Hettinger
7c0b70f419
Minor tweak to the order of variable updates.
2015-09-26 21:11:05 -07:00
Raymond Hettinger
f2b02ced7e
Bump up the maximum number of freeblocks
2015-09-26 17:47:02 -07:00