Commit Graph

1239 Commits

Author SHA1 Message Date
Tim Peters 32a8361f2d After approval from Anthony, merge the tim-current_frames
branch into the trunk.  This adds a new sys._current_frames()
function, which returns a dict mapping thread id to topmost
thread stack frame.
2006-07-10 21:08:24 +00:00
Anthony Baxter 70e8e87750 preparing for 2.5b2 2006-07-10 07:41:04 +00:00
Trent Mick f08d663a2f Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338). 2006-06-19 23:21:25 +00:00
Anthony Baxter d113680720 Preparing for 2.5b1. 2006-06-19 12:04:15 +00:00
Neal Norwitz 0f2783cb4c Use Py_ssize_t 2006-06-19 05:40:44 +00:00
Martin v. Löwis d825143be1 Patch #1455898: Incremental mode for "mbcs" codec. 2006-06-14 05:21:04 +00:00
Andrew MacIntyre 9291332de1 Patch #1454481: Make thread stack size runtime tunable.
Heavily revised, comprising revisions:
46640 - original trunk revision (backed out in r46655)
46647 - markup fix (backed out in r46655)
46692:46918 merged from branch aimacintyre-sf1454481

branch tested on buildbots (Windows buildbots had problems
not related to these changes).
2006-06-13 15:04:24 +00:00
Neal Norwitz b9845e72f9 Get rid of f_restricted too. Doc the other 4 ints that were already removed
at the NeedForSpeed sprint.
2006-06-12 02:11:18 +00:00
Martin v. Löwis 0e8bd7e1cc Patch #1495999: Part two of Windows CE changes.
- update header checks, using autoconf
- provide dummies for getenv, environ, and GetVersion
- adjust MSC_VER check in socketmodule.c
2006-06-10 12:23:46 +00:00
Tim Peters 28eeefe566 Revert revisions:
46640 Patch #1454481:  Make thread stack size runtime tunable.
46647 Markup fix

The first is causing many buildbots to fail test runs, and there
are multiple causes with seemingly no immediate prospects for
repairing them.  See python-dev discussion.

Note that a branch can (and should) be created for resolving these
problems, like

svn copy svn+ssh://svn.python.org/python/trunk -r46640 svn+ssh://svn.python.org/python/branches/NEW_BRANCH

followed by merging rev 46647 to the new branch.
2006-06-04 23:52:47 +00:00
Georg Brandl ddbaa660d3 Patch #1346214: correctly optimize away "if 0"-style stmts
(thanks to Neal for review)
2006-06-04 21:56:52 +00:00
Martin v. Löwis 3f767795f6 Patch #1359618: Speed-up charmap encoder. 2006-06-04 19:36:28 +00:00
Andrew MacIntyre 6539d2d3c7 Patch #1454481: Make thread stack size runtime tunable. 2006-06-04 12:31:09 +00:00
Tim Peters 9b10f7e0cb Convert relevant dict internals to Py_ssize_t.
I don't have a box with nearly enough RAM, or an OS,
that could get close to tickling this, though (requires
a dict w/ at least 2**31 entries).
2006-05-30 04:16:25 +00:00
Fredrik Lundh 80f8e80c15 needforspeed: added Py_MEMCPY macro (currently tuned for Visual C only),
and use it for string copy operations.  this gives a 20% speedup on some
string benchmarks.
2006-05-28 12:06:46 +00:00
Richard Jones 7b9558d37d Conversion of exceptions over from faked-up classes to new-style C types. 2006-05-27 12:29:24 +00:00
Fredrik Lundh 7a83089c06 needforspeed: backed out the Py_LOCAL-isation of ceval; the massive in-
lining killed performance on certain Intel boxes, and the "aggressive"
macro itself gives most of the benefits on others.
2006-05-27 10:39:48 +00:00
Tim Peters 7df5e7f4b2 Patch 1145039.
set_exc_info(), reset_exc_info():  By exploiting the
likely (who knows?) invariant that when an exception's
`type` is NULL, its `value` and `traceback` are also NULL,
save some cycles in heavily-executed code.

This is a "a kronar saved is a kronar earned" patch:  the
speedup isn't reliably measurable, but it obviously does
reduce the operation count in the normal (no exception
raised) path through PyEval_EvalFrameEx().

The tim-exc_sanity branch tries to push this harder, but
is still blowing up (at least in part due to pre-existing
subtle bugs that appear to have no other visible
consequences!).

Not a bugfix candidate.
2006-05-26 23:14:37 +00:00
Fredrik Lundh b3167cbcd7 needforspeed: added rpartition implementation 2006-05-26 18:15:38 +00:00
Fredrik Lundh 57640f5c57 needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
2006-05-26 11:54:04 +00:00
Fredrik Lundh 95e2a91615 use Py_LOCAL also for string and unicode objects 2006-05-26 11:38:15 +00:00
Fredrik Lundh b8b3c8e276 needforspeed: added Py_LOCAL macro, based on the LOCAL macro used
for SRE and others.  applied Py_LOCAL to relevant portion of ceval,
which gives a 1-2% speedup on my machine.  ymmv.
2006-05-26 11:29:39 +00:00
Fredrik Lundh 06a69dd8ff needforspeed: partition implementation, part two.
feel free to improve the documentation and the docstrings.
2006-05-26 08:54:28 +00:00
Tim Peters da53afa1b0 A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c.  Share the table instead.  Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
2006-05-25 17:34:03 +00:00
Kristján Valur Jónsson 44aa9f7139 Fix incorrect documentation for the Py_IS_FINITE(X) macro. 2006-05-25 16:39:27 +00:00
Andrew M. Kuchling cc1ecf4d6d Fix another typo 2006-05-25 16:34:54 +00:00
Andrew M. Kuchling 1d2576dbf0 Fix comment typos 2006-05-25 16:23:15 +00:00
Kristján Valur Jónsson f94323fbb4 Added a new macro, Py_IS_FINITE(X). On windows there is an intrinsic for this and it is more efficient than to use !Py_IS_INFINITE(X) && !Py_IS_NAN(X). No change on other platforms 2006-05-25 15:53:30 +00:00
Richard Jones cebbefc98d Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects. 2006-05-23 18:28:17 +00:00
Richard Jones 7c88dcc5ab Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
2006-05-23 10:37:38 +00:00
Fredrik Lundh 3d885e0195 needforspeed: check first *and* last character before doing a full memcmp 2006-05-23 10:10:57 +00:00
Fredrik Lundh 8a8e05a2b9 needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
2006-05-22 17:12:58 +00:00
Fredrik Lundh f1d60a5384 needforspeed: speed up unicode repeat, unicode string copy 2006-05-22 16:29:30 +00:00
Martin v. Löwis a43190bc78 Patch #1492356: Port to Windows CE (patch set 1). 2006-05-22 09:15:18 +00:00
Thomas Wouters 9df4e6f673 - Add new Warning class, ImportWarning
- Warn-raise ImportWarning when importing would have picked up a directory
   as package, if only it'd had an __init__.py. This swaps two tests (for
   case-ness and __init__-ness), but case-test is not really more expensive,
   and it's not in a speed-critical section.

 - Test for the new warning by importing a common non-package directory on
   sys.path: site-packages

 - In regrtest.py, silence warnings generated by the build-environment
   because Modules/ (which is added to sys.path for Setup-created modules)
   has 'zlib' and '_ctypes' directories without __init__.py's.
2006-04-27 23:13:20 +00:00
Anthony Baxter c7d00327ab 2.5a2 2006-04-27 02:11:24 +00:00
Thomas Wouters 1ddba60e3d Define MAXPATHLEN to be at least PATH_MAX, if that's defined. Python uses
MAXPATHLEN-sized buffers for various output-buffers (like to realpath()),
and that's correct on BSD platforms, but not Linux (which uses PATH_MAX, and
does not define MAXPATHLEN.) Cursory googling suggests Linux is following a
newer standard than BSD, but in cases like this, who knows. Using the
greater of PATH_MAX and 1024 as a fallback for MAXPATHLEN seems to be the
most portable solution.
2006-04-25 15:29:46 +00:00
Jeremy Hylton a4ebc135ac Refactor: Move code that uses co_lnotab from ceval to codeobject 2006-04-18 14:47:00 +00:00
Martin v. Löwis 45294a9562 Remove types from type_list if they have no objects
and unlist_types_without_objects is set.
Give dump_counts a FILE* argument.
2006-04-18 06:24:08 +00:00
Skip Montanaro 3fca463627 C++ compile cleanup: proper declaration of _Py_BuildValue_SizeT 2006-04-18 00:29:29 +00:00
Skip Montanaro 54e964d253 C++ compilation cleanup: Migrate declaration of
_PyObject_Call(Function|Method)_SizeT into Include/abstract.h.  This gets
them under the umbrella of the extern "C" { ... } block in that file.
2006-04-18 00:27:46 +00:00
Tim Peters de2acf6512 frame_traverse(): Use the standard Py_VISIT macro.
Py_VISIT:  cast the `op` argument to PyObject* when calling
`visit()`.  Else the caller has to pay too much attention to
this silly detail (e.g., frame_traverse needs to traverse
`struct _frame *` and `PyCodeObject *` pointers too).
2006-04-15 03:22:46 +00:00
Tim Peters 9d2ced8fa0 There were no comments explaining what Py_CLEAR() did or
why it's important.  Now there are ;-)

If someone else hasn't already, I'll add a Py_CLEAR cleanup
task to the TODO Wiki next.
2006-04-15 02:14:03 +00:00
Martin v. Löwis 5cb6936672 Make Py_BuildValue, PyObject_CallFunction and
PyObject_CallMethod aware of PY_SSIZE_T_CLEAN.
2006-04-14 09:08:42 +00:00
Martin v. Löwis 0cc56e5c59 Introduce asdl_int_seq, to hold cmpop_ty. 2006-04-13 12:29:43 +00:00
Skip Montanaro 869bacd465 revert - breaks build of Python/ast.c w/ gcc 2006-04-13 09:48:28 +00:00
Skip Montanaro b940671186 Use union to discriminate pointer types from enum/int types. 2006-04-13 09:37:01 +00:00
Phillip J. Eby 8920bf24f8 Don't set gi_frame to Py_None, use NULL instead, eliminating some insane
pointer dereferences.
2006-04-12 19:07:15 +00:00
Armin Rigo e170937af6 Ignore the references to the dummy objects used as deleted keys
in dicts and sets when computing the total number of references.
2006-04-12 17:06:05 +00:00
Martin v. Löwis 01b810106c Make _kind types global for C++ compilation.
Explicitly cast void* to int to cmpop_ty.
2006-04-11 08:06:50 +00:00