]> granicus.if.org Git - python/log
python
22 years agoAdded note about updated freeze.py Tool.
Marc-André Lemburg [Thu, 4 Apr 2002 16:17:11 +0000 (16:17 +0000)]
Added note about updated freeze.py Tool.

22 years agoUpdated freeze.py to the new Makefile symbol layout.
Marc-André Lemburg [Thu, 4 Apr 2002 16:15:41 +0000 (16:15 +0000)]
Updated freeze.py to the new Makefile symbol layout.
Fixed a few compiler warnings.

freeze.py now produces binaries which can import shared
modules (unlike before).

22 years agoAdd a note about bool.
Guido van Rossum [Thu, 4 Apr 2002 15:21:33 +0000 (15:21 +0000)]
Add a note about bool.

22 years agoSF 539024, Fix broken link to numpy
Neal Norwitz [Thu, 4 Apr 2002 14:02:45 +0000 (14:02 +0000)]
SF 539024, Fix broken link to numpy

22 years ago_PyMalloc_Realloc(): removed a now-pointless cast.
Tim Peters [Thu, 4 Apr 2002 05:08:31 +0000 (05:08 +0000)]
_PyMalloc_Realloc():  removed a now-pointless cast.

22 years ago_PyMalloc_{Malloc, Realloc}: Strive to meet the doc's promises about
Tim Peters [Thu, 4 Apr 2002 04:44:32 +0000 (04:44 +0000)]
_PyMalloc_{Malloc, Realloc}:  Strive to meet the doc's promises about
what these do given a 0 size argument.  This is so that when pymalloc
is enabled, we don't need to wrap pymalloc calls in goofy little
routines special-casing 0.  Note that it's virtually impossible to meet
the doc's promise that malloc(0) will never return NULL; this makes a
best effort, but not an insane effort.  The code does promise that
realloc(not-NULL, 0) will never return NULL (malloc(0) is much harder).

_PyMalloc_Realloc:  Changed to take over all requests for 0 bytes, and
rearranged to be a little quicker in expected cases.

All over the place:  when resorting to the platform allocator, call
free/malloc/realloc directly, without indirecting thru macros.  This
should avoid needing a nightmarish pile of #ifdef-ery if PYMALLOC_DEBUG
is changed so that pymalloc takes over all Py(Mem, Object} memory
operations (which would add useful debugging info to PyMem_xyz
allocations too).

22 years agoCorrect the descriptions of the PyObject_As*Buffer() return values.
Fred Drake [Thu, 4 Apr 2002 04:10:36 +0000 (04:10 +0000)]
Correct the descriptions of the PyObject_As*Buffer() return values.
This closes SF bug #539081.

22 years agoAs Neal pointed out, bool_print was an order of magnitude too complex.
Guido van Rossum [Thu, 4 Apr 2002 01:00:42 +0000 (01:00 +0000)]
As Neal pointed out, bool_print was an order of magnitude too complex.

22 years agoRepair the Windows build (needs to compile in the new boolobject code).
Tim Peters [Thu, 4 Apr 2002 00:02:02 +0000 (00:02 +0000)]
Repair the Windows build (needs to compile in the new boolobject code).

22 years agoOops. Here are the new files. My apologies.
Guido van Rossum [Wed, 3 Apr 2002 23:01:45 +0000 (23:01 +0000)]
Oops.  Here are the new files.  My apologies.

22 years agoAdd empty section for bool
Andrew M. Kuchling [Wed, 3 Apr 2002 22:44:47 +0000 (22:44 +0000)]
Add empty section for bool

22 years agoAdd the 'bool' type and its values 'False' and 'True', as described in
Guido van Rossum [Wed, 3 Apr 2002 22:41:51 +0000 (22:41 +0000)]
Add the 'bool' type and its values 'False' and 'True', as described in
PEP 285.  Everything described in the PEP is here, and there is even
some documentation.  I had to fix 12 unit tests; all but one of these
were printing Boolean outcomes that changed from 0/1 to False/True.
(The exception is test_unicode.py, which did a type(x) == type(y)
style comparison.  I could've fixed that with a single line using
issubtype(x, type(y)), but instead chose to be explicit about those
places where a bool is expected.

Still to do: perhaps more documentation; change standard library
modules to return False/True from predicates.

22 years agoe macresource.need() to open the W resource file in the application init
Jack Jansen [Wed, 3 Apr 2002 21:52:10 +0000 (21:52 +0000)]
e macresource.need() to open the W resource file in the application init
code (if it isn't open already).

PythonIDE still opens the resource file "manually" because it also uses
presence of the CURS resource to determine whether it needs to adjust
sys.path.

22 years agoSlight modernization.
Fred Drake [Wed, 3 Apr 2002 21:47:47 +0000 (21:47 +0000)]
Slight modernization.

22 years agoFix the names of the classmethod and staticmethod constructors as passed to
Fred Drake [Wed, 3 Apr 2002 21:42:45 +0000 (21:42 +0000)]
Fix the names of the classmethod and staticmethod constructors as passed to
PyArg_ParseTuple() as part of the format string.

22 years agoRemove direct manipulation of the module dict.
Fred Drake [Wed, 3 Apr 2002 21:39:26 +0000 (21:39 +0000)]
Remove direct manipulation of the module dict.

22 years agoGot the example program to work in MachoPython.
Jack Jansen [Wed, 3 Apr 2002 21:28:02 +0000 (21:28 +0000)]
Got the example program to work in MachoPython.

22 years agoUpdated PEP link to point to the now-canonical site.
Fred Drake [Wed, 3 Apr 2002 02:52:50 +0000 (02:52 +0000)]
Updated PEP link to point to the now-canonical site.

22 years agoUpdate the PEP URL format to point to python.org.
Fred Drake [Wed, 3 Apr 2002 02:47:14 +0000 (02:47 +0000)]
Update the PEP URL format to point to python.org.

22 years agoFold some long lines. Delete blank initial line.
Guido van Rossum [Wed, 3 Apr 2002 02:13:37 +0000 (02:13 +0000)]
Fold some long lines.  Delete blank initial line.

22 years agoFix bugs:
Mark Hammond [Wed, 3 Apr 2002 01:47:00 +0000 (01:47 +0000)]
Fix bugs:
 457466: popenx() argument mangling hangs python
 226766: popen('python -c"...."') tends to hang

Fixes argument quoting in w9xpopen.exe for Windows 9x.  w9xpopen.exe
also never attempts to display a MessageBox when not executed
interactively.

Added test_popen() test.  This test currently just executes
"python -c ..." as a child process, and checks that the expected
arguments were all recieved correctly by the child process.  This
test succeeds for me on Win9x, win2k and Linux, and I hope it does
for other popen supported platforms too :)

22 years agoConvert more METH_OLDARGS & PyArg_Parse()
Neal Norwitz [Tue, 2 Apr 2002 18:26:33 +0000 (18:26 +0000)]
Convert more METH_OLDARGS & PyArg_Parse()

Please review.

22 years agoGet rid of more PyArg_Parse & METH_OLDARGS.
Neal Norwitz [Tue, 2 Apr 2002 18:17:57 +0000 (18:17 +0000)]
Get rid of more PyArg_Parse & METH_OLDARGS.
  PyArg_Parse( "s" )  -> PyString_AsString
  PyArg_Parse( "t#" ) -> PyString_AsStringAndSize

22 years agoSF patch 537536 by Phillip J. Eby, fix for SF bug 535444, super()
Guido van Rossum [Tue, 2 Apr 2002 17:53:47 +0000 (17:53 +0000)]
SF patch 537536 by Phillip J. Eby, fix for SF bug 535444, super()
broken w/ classmethods.

Bugfix candidate.

22 years agoAdd a note warning against semicolons following PyObject_HEAD.
Fred Drake [Tue, 2 Apr 2002 15:42:46 +0000 (15:42 +0000)]
Add a note warning against semicolons following PyObject_HEAD.
Minor cleanups.

22 years agoFix for a bug in the fix for SF bug 503031. This time the OP verified
Guido van Rossum [Tue, 2 Apr 2002 14:38:16 +0000 (14:38 +0000)]
Fix for a bug in the fix for SF bug 503031.  This time the OP verified
that it works.

Bugfix candidate (this and the previous checkin, obviously).

22 years agoAdd an item
Andrew M. Kuchling [Tue, 2 Apr 2002 14:25:25 +0000 (14:25 +0000)]
Add an item

22 years agoAdd an experimental mechanism to support extending the pprint formatting.
Fred Drake [Tue, 2 Apr 2002 05:08:35 +0000 (05:08 +0000)]
Add an experimental mechanism to support extending the pprint formatting.
Partly responds to SF bug #505152.

22 years agoMake test_commands work on more systems. This removes much of the dependency
Fred Drake [Mon, 1 Apr 2002 23:56:03 +0000 (23:56 +0000)]
Make test_commands work on more systems.  This removes much of the dependency
on how a system is configured.
This closes SF bug #497160 (which has the patch) and #460613.

Bugfix candidate.

22 years agoExplain that os.spawn*() return the process handle on Windows.
Fred Drake [Mon, 1 Apr 2002 23:30:47 +0000 (23:30 +0000)]
Explain that os.spawn*() return the process handle on Windows.
Clarify that os.waitpid() on Windows takes a process handle, not a process ID.
This closes SF bug #537582.

22 years agoThere is no PyArg_ConvertTuple(); call it by the right name.
Fred Drake [Mon, 1 Apr 2002 23:12:25 +0000 (23:12 +0000)]
There is no PyArg_ConvertTuple(); call it by the right name.
This closes SF bug #537511.

22 years agoFix up the documentation of the type codes to give both the C and Python
Fred Drake [Mon, 1 Apr 2002 23:05:10 +0000 (23:05 +0000)]
Fix up the documentation of the type codes to give both the C and Python
types for each code, and give the actual C types.

Clarified the support for slice operations and note when some TypeError
exceptions are raised.

This closes SF bugs 518767 and 536469.

22 years agoChange reference to execframes to naming.
Jeremy Hylton [Mon, 1 Apr 2002 21:34:28 +0000 (21:34 +0000)]
Change reference to execframes to naming.

22 years agoRestore a minimal definition of execution frame, since other parts of
Jeremy Hylton [Mon, 1 Apr 2002 21:33:55 +0000 (21:33 +0000)]
Restore a minimal definition of execution frame, since other parts of
the manual refer to it.

XXX Not sure that it belongs in this section, or that the concept is
particularly important for writing documentation.  Perhaps references
to the frame should be removed entirely.

22 years agoUpdate programmer's note on nested functions.
Jeremy Hylton [Mon, 1 Apr 2002 21:30:15 +0000 (21:30 +0000)]
Update programmer's note on nested functions.

22 years agoReword explanation of global statement since an undeclared global is a
Jeremy Hylton [Mon, 1 Apr 2002 21:25:32 +0000 (21:25 +0000)]
Reword explanation of global statement since an undeclared global is a
free variable and is subject to those rules.

22 years agoNote the sole case in which the ban on "from ... import *" within a
Jeremy Hylton [Mon, 1 Apr 2002 21:19:44 +0000 (21:19 +0000)]
Note the sole case in which the ban on "from ... import *" within a
function is enforced.

22 years agoRemove the following restriction:
Jeremy Hylton [Mon, 1 Apr 2002 21:18:02 +0000 (21:18 +0000)]
Remove the following restriction:

    Names bound by import statements may not occur in global
    statements in the same scope.

Why not?

22 years agoNote that it is illegal to delete a cell variable.
Jeremy Hylton [Mon, 1 Apr 2002 21:15:14 +0000 (21:15 +0000)]
Note that it is illegal to delete a cell variable.

Note that deleteing an unbound local will raise a NameError.

22 years agoGiven lambda its own section, instead of burying it in boolean operators.
Jeremy Hylton [Mon, 1 Apr 2002 21:05:21 +0000 (21:05 +0000)]
Given lambda its own section, instead of burying it in boolean operators.

22 years agoUpdate / simplify Identifiers section for nested scopes.
Jeremy Hylton [Mon, 1 Apr 2002 20:52:24 +0000 (20:52 +0000)]
Update / simplify Identifiers section for nested scopes.

How do I create a cross reference to section 4.1?

22 years agoUpdate docs for nested scopes.
Jeremy Hylton [Mon, 1 Apr 2002 20:38:01 +0000 (20:38 +0000)]
Update docs for nested scopes.

Replace section 4.1 with section A.3.

The new section 4.1 is titled "Naming and binding."  It includes the
text of section A.3 augmented with some of the detailed text from the
old section 4.1.

The \dfn, \index stuff is probably wrong, but I tried.

Also update other parts of appendix A to mention that nested scopes
and generators are standard features.

22 years agoUpdate to push the docs to python.org instead of python.sf.net.
Fred Drake [Mon, 1 Apr 2002 20:15:05 +0000 (20:15 +0000)]
Update to push the docs to python.org instead of python.sf.net.

22 years agoFixed errors in two comments.
Tim Peters [Mon, 1 Apr 2002 20:12:59 +0000 (20:12 +0000)]
Fixed errors in two comments.

22 years agoCopy section on generators from the 2.2 document with a bit of rewriting
Andrew M. Kuchling [Mon, 1 Apr 2002 19:28:09 +0000 (19:28 +0000)]
Copy section on generators from the 2.2 document with a bit of rewriting
Add an item

22 years agoRestructured my pool-management overview in terms of the three
Tim Peters [Mon, 1 Apr 2002 19:23:44 +0000 (19:23 +0000)]
Restructured my pool-management overview in terms of the three
possible pool states.  I think it's much clearer now.

Added a new long overdue block-management overview comment block.

I believe the comments are in good shape now.

Added two comments about possible small optimizations (one getting rid
of runtime multiplications at the cost of a new pool_header member; the
other getting rid of runtime divisions and the pool_header capacity
member, at the cost of a static const vector of 32 uints).

22 years agoMention 2.2.1 in intro and in bug/patch counts
Andrew M. Kuchling [Mon, 1 Apr 2002 19:22:34 +0000 (19:22 +0000)]
Mention 2.2.1 in intro and in bug/patch counts
Fix two typos spotted by Joonas Paalasmaa

22 years agoFormat strings (tuples,) appropriately
Neal Norwitz [Mon, 1 Apr 2002 19:01:39 +0000 (19:01 +0000)]
Format strings (tuples,) appropriately

22 years agoUse attributes appropriately
Neal Norwitz [Mon, 1 Apr 2002 19:00:50 +0000 (19:00 +0000)]
Use attributes appropriately

22 years agoThere is no TestError, use TestFailed appropriately
Neal Norwitz [Mon, 1 Apr 2002 18:59:20 +0000 (18:59 +0000)]
There is no TestError, use TestFailed appropriately

22 years agoUpdate documentation of code objects.
Jeremy Hylton [Mon, 1 Apr 2002 18:53:36 +0000 (18:53 +0000)]
Update documentation of code objects.

Split the description of co_flags into two paragraphs.  The first
describes the flags that are used for non-future purposes, where
CO_GENERATOR was added.  The second describes __future__'s use of
co_flags and mentions the only one currently meaningful,
CO_FUTURE_DIVISION.

22 years agoMinor adjustments.
Fred Drake [Mon, 1 Apr 2002 18:49:45 +0000 (18:49 +0000)]
Minor adjustments.

22 years agoSmall fixes for description of function attributes.
Jeremy Hylton [Mon, 1 Apr 2002 17:58:39 +0000 (17:58 +0000)]
Small fixes for description of function attributes.

func_closure is a readonly attribute.
Add \ttindex{} for func_closure.
Remove discussion of func_closure specific to 2.1.

22 years agoReindent. Break long lines. Move comments before the statements.
Martin v. Löwis [Mon, 1 Apr 2002 17:40:08 +0000 (17:40 +0000)]
Reindent. Break long lines. Move comments before the statements.

22 years agoUse the PyModule_Add*() APIs instead of manipulating the module dict
Fred Drake [Mon, 1 Apr 2002 14:53:37 +0000 (14:53 +0000)]
Use the PyModule_Add*() APIs instead of manipulating the module dict
directly.

22 years agoRemove all but one use of the module dict.
Fred Drake [Mon, 1 Apr 2002 14:49:59 +0000 (14:49 +0000)]
Remove all but one use of the module dict.

22 years agoRemove unused variable and call to PyModule_GetDict().
Fred Drake [Mon, 1 Apr 2002 14:30:50 +0000 (14:30 +0000)]
Remove unused variable and call to PyModule_GetDict().

22 years agoSwitch to using METH_NOARGS where possible.
Fred Drake [Mon, 1 Apr 2002 14:28:58 +0000 (14:28 +0000)]
Switch to using METH_NOARGS where possible.
Convert to use PyModule_*() instead of manipulating the module dict directly.

22 years agoRemove UNLESS.
Martin v. Löwis [Mon, 1 Apr 2002 12:34:33 +0000 (12:34 +0000)]
Remove UNLESS.

22 years agoNew PYMALLOC_DEBUG function void _PyMalloc_DebugDumpStats(void).
Tim Peters [Mon, 1 Apr 2002 06:04:21 +0000 (06:04 +0000)]
New PYMALLOC_DEBUG function void _PyMalloc_DebugDumpStats(void).
This displays stats about the # of arenas, pools, blocks and bytes, to
stderr, both used and reserved but unused.

CAUTION:  Because PYMALLOC_DEBUG is on, the debug malloc routine adds
16 bytes to each request.  This makes each block appear two size classes
higher than it would be if PYMALLOC_DEBUG weren't on.

So far, playing with this confirms the obvious:  there's a lot of activity
in the "small dict" size class, but nothing in the core makes any use of
the 8-byte or 16-byte classes.

22 years agoWe expect to skip the new test_mpz on Windows.
Tim Peters [Mon, 1 Apr 2002 05:04:46 +0000 (05:04 +0000)]
We expect to skip the new test_mpz on Windows.

22 years agoUse the PyModule_*() API instead of manipulating the module dictionary
Fred Drake [Mon, 1 Apr 2002 03:45:06 +0000 (03:45 +0000)]
Use the PyModule_*() API instead of manipulating the module dictionary
directly.

22 years agoGet rid of another use of PyArg_Parse()
Neal Norwitz [Mon, 1 Apr 2002 01:41:20 +0000 (01:41 +0000)]
Get rid of another use of PyArg_Parse()

22 years agoGet rid of all METH_OLDARGS & PyArg_Parse.
Neal Norwitz [Mon, 1 Apr 2002 01:37:14 +0000 (01:37 +0000)]
Get rid of all METH_OLDARGS & PyArg_Parse.
Fix floating point exception if mpz.powm(10, 1, 0) (modulus == 0).
Add a test.

22 years agoRemove some now-obsolete generator future statements.
Tim Peters [Mon, 1 Apr 2002 00:28:59 +0000 (00:28 +0000)]
Remove some now-obsolete generator future statements.
I left the email pkg alone; I'm not sure how Barry would like to handle
that.

22 years agoConvert file.readinto() to stop using METH_OLDARGS & PyArg_Parse.
Neal Norwitz [Mon, 1 Apr 2002 00:09:00 +0000 (00:09 +0000)]
Convert file.readinto() to stop using METH_OLDARGS & PyArg_Parse.
Add test for file.readinto().

22 years agoHopeful fix for SF bug 503031: urllib.py: open_http() host problem.
Guido van Rossum [Sun, 31 Mar 2002 23:38:48 +0000 (23:38 +0000)]
Hopeful fix for SF bug 503031: urllib.py: open_http() host problem.

I really can't test this, but from reading the discussion in that bug
report, it's likely that this works.  It may also close a whole bunch
of other bug reports related to urllib and proxies on Windows, but who
knows.

22 years agompz_float() only takes one parameter now
Neal Norwitz [Sun, 31 Mar 2002 22:02:37 +0000 (22:02 +0000)]
mpz_float() only takes one parameter now

22 years agoAdded a "run with commandline Python" flag. Works in MachoPython, should work
Jack Jansen [Sun, 31 Mar 2002 22:01:33 +0000 (22:01 +0000)]
Added a "run with commandline Python" flag. Works in MachoPython, should work
in OSX MacPython (untested), and should be disabled/removed in OS9 (but
that doesn't happen yet).

22 years agoGet rid of warnings due to changing to METH_NOARGS
Neal Norwitz [Sun, 31 Mar 2002 16:13:39 +0000 (16:13 +0000)]
Get rid of warnings due to changing to METH_NOARGS

22 years agoUse METH_VARARGS rather than METH_OLDARGS implicitly (args are ignored)
Neal Norwitz [Sun, 31 Mar 2002 16:06:11 +0000 (16:06 +0000)]
Use METH_VARARGS rather than METH_OLDARGS implicitly (args are ignored)

22 years agoConvert METH_OLDARGS -> METH_NOARGS: remove args parameter
Neal Norwitz [Sun, 31 Mar 2002 15:56:56 +0000 (15:56 +0000)]
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Use METH_OLDARGS explicitly rather than implicitly.

22 years agoRevert use of METH_OLDARGS (use 0) to support 1.5.2
Neal Norwitz [Sun, 31 Mar 2002 15:46:00 +0000 (15:46 +0000)]
Revert use of METH_OLDARGS (use 0) to support 1.5.2

22 years agoConvert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple
Neal Norwitz [Sun, 31 Mar 2002 15:43:28 +0000 (15:43 +0000)]
Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple
Please review for correctness.

22 years agoRemove METH_OLDARGS:
Neal Norwitz [Sun, 31 Mar 2002 15:27:00 +0000 (15:27 +0000)]
Remove METH_OLDARGS:
  Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple
  Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Please review.  All tests pass, but some modules don't have tests.
I spot checked various functions to try to make sure nothing broke.

22 years agoConvert from using METH_OLDARGS to METH_NOARGS.
Neal Norwitz [Sun, 31 Mar 2002 14:57:24 +0000 (14:57 +0000)]
Convert from using METH_OLDARGS to METH_NOARGS.
These should be safe.

22 years agoFix whitespace
Neal Norwitz [Sun, 31 Mar 2002 14:55:17 +0000 (14:55 +0000)]
Fix whitespace

22 years agoUse symbolic METH_VARARGS/METH_OLDARGS instead of 1/0 for ml_flags
Neal Norwitz [Sun, 31 Mar 2002 14:44:22 +0000 (14:44 +0000)]
Use symbolic METH_VARARGS/METH_OLDARGS instead of 1/0 for ml_flags

22 years agoUse symbolic METH_VARARGS instead of 1 for ml_flags
Neal Norwitz [Sun, 31 Mar 2002 14:37:44 +0000 (14:37 +0000)]
Use symbolic METH_VARARGS instead of 1 for ml_flags

22 years agoUse docstrings for exception classes
Neal Norwitz [Sun, 31 Mar 2002 14:06:41 +0000 (14:06 +0000)]
Use docstrings for exception classes

22 years agoDerive exception classes from Exception
Neal Norwitz [Sun, 31 Mar 2002 13:59:18 +0000 (13:59 +0000)]
Derive exception classes from Exception

22 years agoStop using string exceptions
Neal Norwitz [Sun, 31 Mar 2002 13:58:20 +0000 (13:58 +0000)]
Stop using string exceptions

22 years agoAdd one more assert that indirectly interlocking conditions are consistent
Tim Peters [Sun, 31 Mar 2002 02:59:48 +0000 (02:59 +0000)]
Add one more assert that indirectly interlocking conditions are consistent
with each other.

22 years agoFixed an error in a new assert.
Tim Peters [Sun, 31 Mar 2002 02:52:29 +0000 (02:52 +0000)]
Fixed an error in a new assert.

22 years agoFixed a typo in a new comment.
Tim Peters [Sun, 31 Mar 2002 02:51:40 +0000 (02:51 +0000)]
Fixed a typo in a new comment.

22 years ago_PyMalloc_Free(): As was already done for _PyMalloc_Malloc, rearranged
Tim Peters [Sun, 31 Mar 2002 02:18:01 +0000 (02:18 +0000)]
_PyMalloc_Free():  As was already done for _PyMalloc_Malloc, rearranged
the code so that the most frequent cases come first.  Added comments.
Found a hidden assumption that a pool contains room for at least two
blocks, and added an assert to catch a violation if it ever happens in
a place where that matters.  Gave the normal "I allocated this block"
case a longer basic block to work with before it has to do its first
branch (via breaking apart an embedded assignment in an "if", and
hoisting common code out of both branches).

22 years agoAdded a long-overdue comment block giving an overview of pool operations
Tim Peters [Sun, 31 Mar 2002 01:05:22 +0000 (01:05 +0000)]
Added a long-overdue comment block giving an overview of pool operations
and terminology, plus explanation of some extreme obscurities.

22 years agoSuite to talk to the OSX Terminal application.
Jack Jansen [Sat, 30 Mar 2002 23:46:16 +0000 (23:46 +0000)]
Suite to talk to the OSX Terminal application.

22 years agoGot rid of obsolete way to get at various toolbox types.
Jack Jansen [Sat, 30 Mar 2002 23:44:58 +0000 (23:44 +0000)]
Got rid of obsolete way to get at various toolbox types.

22 years agoAdd Mac/Lib/lib-scriptpackages to sys.path too.
Jack Jansen [Sat, 30 Mar 2002 23:43:36 +0000 (23:43 +0000)]
Add Mac/Lib/lib-scriptpackages to sys.path too.

22 years agoModified to allow it to run in MachoPython in a reasonable way. It still
Jack Jansen [Sat, 30 Mar 2002 23:43:04 +0000 (23:43 +0000)]
Modified to allow it to run in MachoPython in a reasonable way. It still
needs a decent commandline interface, though.

22 years agoIt's once again thought safe to call the pymalloc free/realloc with an
Tim Peters [Sat, 30 Mar 2002 21:36:04 +0000 (21:36 +0000)]
It's once again thought safe to call the pymalloc free/realloc with an
address obtained from system malloc/realloc without holding the GIL.

When the vector of arena base addresses has to grow, the old vector is
deliberately leaked.  This makes "stale" x-thread references safe.
arenas and narenas are also declared volatile, and changed in an order
that prevents a thread from picking up a value of narenas too large
for the value of arenas it sees.

Added more asserts.

Fixed an old inaccurate comment.

Added a comment explaining why it's safe to call pymalloc free/realloc
with an address obtained from system malloc/realloc even when arenas is
still NULL (this is obscure, since the ADDRESS_IN_RANGE macro
appears <wink> to index into arenas).

22 years agonew_arena(): In error cases, reset the number of available pools to 0.
Tim Peters [Sat, 30 Mar 2002 10:42:09 +0000 (10:42 +0000)]
new_arena():  In error cases, reset the number of available pools to 0.
Else the pymalloc malloc will go insane the next time it's called.

22 years agoChanged the #-of-arenas counters to uints -- no need to be insane about
Tim Peters [Sat, 30 Mar 2002 10:35:09 +0000 (10:35 +0000)]
Changed the #-of-arenas counters to uints -- no need to be insane about
this.  But added an overflow check just in case there is.

Got rid of the ushort macro.  It wasn't used anymore (it was only used
in the no-longer-exists off_t macro), and there's no plausible use for it.

22 years agoEliminate DONT_SHARE_SHORT_STRINGS.
Tim Peters [Sat, 30 Mar 2002 10:06:07 +0000 (10:06 +0000)]
Eliminate DONT_SHARE_SHORT_STRINGS.

22 years agoPatch #536908: Add missing #include guards/extern "C".
Martin v. Löwis [Sat, 30 Mar 2002 08:57:12 +0000 (08:57 +0000)]
Patch #536908: Add missing #include guards/extern "C".

22 years agoTurns out the off_t macro isn't used anymore, so got rid of it.
Tim Peters [Sat, 30 Mar 2002 07:07:24 +0000 (07:07 +0000)]
Turns out the off_t macro isn't used anymore, so got rid of it.

22 years agoNow that we're no longer linking arenas together, there's no need to
Tim Peters [Sat, 30 Mar 2002 07:04:41 +0000 (07:04 +0000)]
Now that we're no longer linking arenas together, there's no need to
waste the first pool if malloc happens to return a pool-aligned address.

This means the number of pools per arena can now vary by 1.  Unfortunately,
the code counted up from 0 to a presumed constant number of pools.  So
changed the increasing "watermark" counter to a decreasing "nfreepools"
counter instead, and fiddled various stuff accordingly.  This also allowed
getting rid of two more macros.

Also changed the code to align the first address to a pool boundary
instead of a page boundary.  These are two parallel sets of macro #defines
that happen to be identical now, but the page macros are in theory more
restrictive (bigger), and there's simply no reason I can see that it
wasn't aligning to the less restrictive pool size all along (the code
only relies on pool alignment).

Hmm.  The "page size" macros aren't used for anything *except* defining
the pool size macros, and the comments claim the latter isn't necessary.
So this has the feel of a layer of indirection that doesn't serve a
purpose; should probably get rid of the page macros now.

22 years agoRetract the claim that this is always safe if PyMem_{Del, DEL, Free, FREE}
Tim Peters [Sat, 30 Mar 2002 06:20:23 +0000 (06:20 +0000)]
Retract the claim that this is always safe if PyMem_{Del, DEL, Free, FREE}
are called without the GIL.  It's incredibly unlikely to fail, but I can't
make this bulletproof without either adding a lock for exclusion, or
giving up on growing the arena base-address vector (it would be safe if
this were a static array).

22 years agoLots of changes:
Tim Peters [Sat, 30 Mar 2002 06:09:22 +0000 (06:09 +0000)]
Lots of changes:

+ A new scheme for determining whether an address belongs to a pymalloc
  arena.  This should be 100% reliable.  The poolp->pooladdr and
  poolp->magic members are gone.  A new poolp->arenaindex member takes
  their place.  Note that the pool header overhead doesn't actually
  shrink, though, since the header is padded to a multiple of 8 bytes.

+ _PyMalloc_Free and _PyMalloc_Realloc should now be safe to call for
  any legit address, whether obtained from a _PyMalloc function or from
  the system malloc/realloc.  It should even be safe to call
   _PyMalloc_Free when *not* holding the GIL, provided that the passed-in
  address was obtained from system malloc/realloc.  Since this is
  accomplished without any locks, you better believe the code is subtle.
  I hope it's sufficiently commented.

+ The above implies we don't need the new PyMalloc_{New, NewVar, Del}
  API anymore, and could switch back to PyObject_XXX without breaking
  existing code mixing PyObject_XXX with PyMem_{Del, DEL, Free, FREE}.
  Nothing is done here about that yet, and I'd like to see this new
  code exercised more first.

+ The small object threshhold is boosted to 256 (the max).  We should
  play with that some more, but the old 64 was way too small for 2.3.

+ Getting a new arena is now done via new function new_arena().

+ Removed some unused macros, and squashed out some macros that were
  used only once to define other macros.

+ Arenas are no longer linked together.  A new vector of arena base
  addresses had to be created anyway to make address classification
  bulletproof.

+ A lot of the patch size is an illusion:  given the way address
  classification works now, it was more convenient to switch the
  sense of the prime "if" tests in the realloc and free functions,
  so the "if" and "else" blocks got swapped.

+ Assorted minor code, comment and whitespace cleanup.

Back to the Windows installer <wink>.