Commit graph

423 commits

Author SHA1 Message Date
Guido van Rossum
d085e88d3c Added Py_Malloc and friends as well as PyMem_Malloc and friends. 1997-08-05 01:59:22 +00:00
Guido van Rossum
29e46a9a12 Mass checkin (more to follow for other directories).
Introduce truly separate (sub)interpreter objects.  For now, these
must be used by separate threads, created from C.  See Demo/pysvr for
an example of how to use this.  This also rationalizes Python's
initialization and finalization behavior:

Py_Initialize() -- initialize the whole interpreter
Py_Finalize() -- finalize the whole interpreter

tstate = Py_NewInterpreter() -- create a new (sub)interpreter
Py_EndInterpreter(tstate) -- delete a new (sub)interpreter

There are also new interfaces relating to threads and the interpreter
lock, which can be used to create new threads, and sometimes have to
be used to manipulate the interpreter lock when creating or deleting
sub-interpreters.  These are only defined when WITH_THREAD is defined:

PyEval_AcquireLock() -- acquire the interpreter lock
PyEval_ReleaseLock() -- release the interpreter lock

PyEval_AcquireThread(tstate) -- acquire the lock and make the thread current
PyEval_ReleaseThread(tstate) -- release the lock and make NULL current

Other administrative changes:

- The header file bltinmodule.h is deleted.

- The init functions for Import, Sys and Builtin are now internal and
  declared in pythonrun.h.

- Py_Setup() and Py_Cleanup() are no longer declared.

- The interpreter state and thread state structures are now linked
  together in a chain (the chain of interpreters is a static variable
  in pythonrun.c).

- Some members of the interpreter and thread structures have new,
  shorter, more consistent, names.

- Added declarations for _PyImport_{Find,Fixup}Extension() to import.h.
1997-08-02 02:56:48 +00:00
Guido van Rossum
7a2d6112d9 Add cast to PyInt_AS_LONG macro, as suggested by Marc Lemburg. 1997-08-02 02:41:13 +00:00
Guido van Rossum
2981bc7a65 Add cast to PyFloat_AS_DOUBLE macro, as suggested by Marc Lemburg. 1997-08-02 02:40:58 +00:00
Guido van Rossum
766118525a Changed the patch level to 1.5a3, to avoid confusion with a2 (I'm not
ready for a release yet).
1997-07-19 23:46:59 +00:00
Guido van Rossum
57d8e3f1c7 Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Py_Get*() functions.
1997-07-19 19:50:52 +00:00
Guido van Rossum
5617f32c5c Added decl for PyInt_GetMax(). 1997-07-19 19:49:11 +00:00
Guido van Rossum
a847889607 Moved PyEval_InitThreads to inside WITH_THREAD, where it belongs. 1997-07-19 19:27:30 +00:00
Guido van Rossum
e6fb2043ce Got rid of "suppres printing" flag. 1997-07-19 19:26:38 +00:00
Guido van Rossum
618af4b3ef Include pystate.h earlier so it can be referenced by ceval.h. 1997-07-18 23:59:26 +00:00
Guido van Rossum
2fca21f762 PyEval_SaveThread() and PyEval_RestoreThread() now return/take a
PyThreadState pointer instead of a (frame) PyObject pointer.  This
makes much more sense.  It is backward incompatible, but that's no
problem, because (a) the heaviest users are the Py_{BEGIN,END}_
ALLOW_THREADS macros here, which have been fixed too; (b) there are
very few direct users; (c) those who use it are there will probably
appreciate the change.

Also, added new functions PyEval_AcquireThread() and
PyEval_ReleaseThread() which allows the threads created by the thread
module as well threads created by others (!) to set/reset the current
thread, and at the same time acquire/release the interpreter lock.

Much saner.
1997-07-18 23:56:58 +00:00
Guido van Rossum
4b11c74f7c Only add 1 byte to all malloc calls when it is known that malloc(0) or
realloc(p, 0) returns NULL.  See changes to configure script to be
checked in later.
1997-07-10 22:40:54 +00:00
Guido van Rossum
745b8cff08 flushline and writestring can now return an error 1997-05-22 22:23:46 +00:00
Guido van Rossum
59943ba718 Added Py_PROTO macros for SunOS 4.x /bin/cc. 1997-05-20 22:07:46 +00:00
Guido van Rossum
c23ef0a6e8 Workaround for bug in Metrowerks MSL headers on 68K Macs (Jack) 1997-05-20 15:58:15 +00:00
Guido van Rossum
d0c87ee6c4 Oops, another forgotten renaming: varobject -> PyVarObject. 1997-05-15 21:31:03 +00:00
Guido van Rossum
4346716962 Bump level to 1.5a2. 1997-05-14 21:41:46 +00:00
Guido van Rossum
2ec9031b55 Subsumed mappingobject.h in dictobject.h. 1997-05-13 21:23:32 +00:00
Guido van Rossum
6a33de9526 Get rid of obsolete ACCESS_MODE opcode. 1997-05-09 00:39:04 +00:00
Guido van Rossum
6778f257b7 Oops, rename2.h was included by some other headers. 1997-05-07 23:50:40 +00:00
Guido van Rossum
b05a5c7698 Instead of importing graminit.h whenever one of the three grammar 'root'
symbols is needed, define these in Python.h with a Py_ prefix.
1997-05-07 17:46:13 +00:00
Guido van Rossum
fdf95dd525 Checkin of Jack's buffer mods.
Not really checked, but didn't fail any tests either...
1997-05-05 22:15:02 +00:00
Guido van Rossum
a027efa5bf Massive changes for separate thread state management.
All per-thread globals are moved into a struct which is manipulated
separately.
1997-05-05 20:56:21 +00:00
Guido van Rossum
4a43cc67db Remove sys_* defines that are internal only and about to disappear 1997-05-05 20:46:18 +00:00
Guido van Rossum
84bf42531c Finally deleted this obsolete crud. 1997-05-02 04:01:08 +00:00
Guido van Rossum
d27b4f2a3f Several oopsies -- Py_ALLOBJECTS_H -> Py_PYTHON_H, temporarily removed
pystate.h (to be restored later when that code is debugged), removed
accessobject.h.
1997-05-02 04:00:11 +00:00
Guido van Rossum
174f95adf7 Moved allobjects.h to Python.h (without rename2.h).
allobjects.h disappears -- old-style extensions must include Python.h
and rename2.h.
1997-05-02 03:55:52 +00:00
Guido van Rossum
87490eb3b0 Renamed inittab. 1997-04-29 20:31:59 +00:00
Guido van Rossum
e601c0f55d Added new name for inittab! 1997-04-29 16:23:44 +00:00
Guido van Rossum
63c35e5407 Remove macros that are only used for cgensupport.[ch].
Fixed typo in PyArg_VaParse (not PyArgs_*).
1997-04-29 16:21:39 +00:00
Guido van Rossum
92e8782217 Moved cgensupport.h to Modules (awaiting oblivion). 1997-04-29 16:08:53 +00:00
Guido van Rossum
1818b7702b Moved rename2's macros relevant to this module here and added comment
about the file's obsolescence.
1997-04-29 15:35:28 +00:00
Guido van Rossum
45c3aaba56 Got rid of the static decl of PyCObject_Import, which was a 1.4
compatibility hack.
1997-04-09 18:04:08 +00:00
Guido van Rossum
0a73dd5f35 Changed the way the C API was exported. Jim Fulton. 1997-04-09 17:34:28 +00:00
Guido van Rossum
8ecd1ad785 Added assert grammar. 1997-04-02 05:24:08 +00:00
Guido van Rossum
6fa4466cec Added AssertionError. 1997-04-02 05:22:53 +00:00
Guido van Rossum
94dbd99483 Remove ConflictError (which was also removed from bltinmodule.c, even
though the checkin message failed to note that).
1997-03-31 17:19:40 +00:00
Guido van Rossum
e053c67780 Remove err_input -- there is no such global! 1997-03-14 05:09:30 +00:00
Guido van Rossum
f0958064f9 Remove redundant references to thread stuff -- long, long ago, there
was some locking code in this file that needed it...
1997-03-14 04:25:22 +00:00
Guido van Rossum
74277916a9 Add Macros defining new names for all external symbols. 1997-03-14 04:24:08 +00:00
Guido van Rossum
1f06beeedd Change PyFPE_END_PROTECT to PyFPE_END_PROTECT(v). v should be the
last variable to which a floating point expression is assigned.  The
macro passes its address to a dummy function so that the optimizer
can't delay calculating its value until after the macro.
1997-03-14 04:23:42 +00:00
Guido van Rossum
f39fc43f31 A few comment alignment and clarifications. 1997-03-04 18:31:47 +00:00
Guido van Rossum
e9e47796c8 Add global Py_OptimizeFlag. 1997-03-03 19:13:54 +00:00
Guido van Rossum
7d4266ed5a Changes for Lee Busby's SIGFPE patch set.
New file pyfpe.h, new exception FloatingPointError.
1997-02-14 22:53:12 +00:00
Guido van Rossum
1ca407f3e4 Fix the comments for bitwise and/or. 1997-02-14 22:51:40 +00:00
Guido van Rossum
5c4998b236 Added decl for Py_FdIsInteractive. 1997-02-14 19:51:34 +00:00
Guido van Rossum
3f3a2686b8 Added decl for Py_InteractiveFlag. 1997-02-14 19:51:09 +00:00
Guido van Rossum
c4193f1547 Added prototype for PyErr_Format(exception, formatstring, ...) -> NULL. 1997-02-14 17:10:25 +00:00
Guido van Rossum
36280a7772 Added PyArg_ParseTupleAndKeywords() prototype. 1997-02-14 16:36:35 +00:00
Guido van Rossum
fb76f1af9b djgpp support. 1997-02-14 16:36:08 +00:00