mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
The great renaming, phase two: all header files have been updated to
use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
This commit is contained in:
parent
94390ec2a6
commit
caa6380886
48 changed files with 982 additions and 579 deletions
|
@ -34,7 +34,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
Additional macros for modules that implement new object types.
|
||||
You must first include "object.h".
|
||||
|
||||
NEWOBJ(type, typeobj) allocates memory for a new object of the given
|
||||
PyObject_NEW(type, typeobj) allocates memory for a new object of the given
|
||||
type; here 'type' must be the C structure type used to represent the
|
||||
object and 'typeobj' the address of the corresponding type object.
|
||||
Reference count and type pointer are filled in; the rest of the bytes of
|
||||
|
@ -42,16 +42,16 @@ the object are *undefined*! The resulting expression type is 'type *'.
|
|||
The size of the object is actually determined by the tp_basicsize field
|
||||
of the type object.
|
||||
|
||||
NEWVAROBJ(type, typeobj, n) is similar but allocates a variable-size
|
||||
object with n extra items. The size is computer as tp_basicsize plus
|
||||
PyObject_NEW_VAR(type, typeobj, n) is similar but allocates a variable-size
|
||||
object with n extra items. The size is computed as tp_basicsize plus
|
||||
n * tp_itemsize. This fills in the ob_size field as well.
|
||||
*/
|
||||
|
||||
extern object *newobject PROTO((typeobject *));
|
||||
extern varobject *newvarobject PROTO((typeobject *, unsigned int));
|
||||
extern PyObject *_PyObject_New Py_PROTO((PyTypeObject *));
|
||||
extern varobject *_PyObject_NewVar Py_PROTO((PyTypeObject *, unsigned int));
|
||||
|
||||
#define NEWOBJ(type, typeobj) ((type *) newobject(typeobj))
|
||||
#define NEWVAROBJ(type, typeobj, n) ((type *) newvarobject(typeobj, n))
|
||||
#define PyObject_NEW(type, typeobj) ((type *) _PyObject_New(typeobj))
|
||||
#define PyObject_NEW_VAR(type, typeobj, n) ((type *) _PyObject_NewVar(typeobj, n))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue