Back to index

python3.2  3.2.2
Classes | Defines | Typedefs | Functions | Variables
objimpl.h File Reference
#include "pymem.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  _gc_head
struct  _gc_head.gc

Defines

#define PyObject_MALLOC   PyMem_MALLOC
#define PyObject_REALLOC   PyMem_REALLOC
#define PyObject_FREE   PyMem_FREE
#define PyObject_Del   PyObject_Free
#define PyObject_DEL   PyObject_FREE
#define PyObject_New(type, typeobj)   ( (type *) _PyObject_New(typeobj) )
#define PyObject_NewVar(type, typeobj, n)   ( (type *) _PyObject_NewVar((typeobj), (n)) )
#define PyObject_INIT(op, typeobj)   ( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
#define PyObject_INIT_VAR(op, typeobj, size)   ( Py_SIZE(op) = (size), PyObject_INIT((op), (typeobj)) )
#define _PyObject_SIZE(typeobj)   ( (typeobj)->tp_basicsize )
#define _PyObject_VAR_SIZE(typeobj, nitems)
#define PyObject_NEW(type, typeobj)
#define PyObject_NEW_VAR(type, typeobj, n)
#define PyType_IS_GC(t)   PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
#define PyObject_IS_GC(o)
#define PyObject_GC_Resize(type, op, n)   ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) )
#define _Py_AS_GC(o)   ((PyGC_Head *)(o)-1)
#define _PyGC_REFS_UNTRACKED   (-2)
#define _PyGC_REFS_REACHABLE   (-3)
#define _PyGC_REFS_TENTATIVELY_UNREACHABLE   (-4)
#define _PyObject_GC_TRACK(o)
#define _PyObject_GC_UNTRACK(o)
#define _PyObject_GC_IS_TRACKED(o)   ((_Py_AS_GC(o))->gc.gc_refs != _PyGC_REFS_UNTRACKED)
#define _PyObject_GC_MAY_BE_TRACKED(obj)
#define PyObject_GC_New(type, typeobj)   ( (type *) _PyObject_GC_New(typeobj) )
#define PyObject_GC_NewVar(type, typeobj, n)   ( (type *) _PyObject_GC_NewVar((typeobj), (n)) )
#define Py_VISIT(op)
#define PyType_SUPPORTS_WEAKREFS(t)   ((t)->tp_weaklistoffset > 0)
#define PyObject_GET_WEAKREFS_LISTPTR(o)   ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))

Typedefs

typedef union _gc_head PyGC_Head

Functions

 PyAPI_FUNC (void *) PyObject_Malloc(size_t)
 PyAPI_FUNC (void) PyObject_Free(void *)
 PyAPI_FUNC (PyObject *) PyObject_Init(PyObject *
PyTypeObjectPyAPI_FUNC (PyVarObject *) PyObject_InitVar(PyVarObject *
 PyAPI_FUNC (Py_ssize_t) PyGC_Collect(void)

Variables

 size_t
PyTypeObject PyTypeObject Py_ssize_t
PyGC_Head_PyGC_generation0

Class Documentation

union _gc_head

Definition at line 247 of file objimpl.h.

Collaboration diagram for _gc_head:
Class Members
long double dummy
struct _gc_head gc
struct _gc_head.gc

Definition at line 248 of file objimpl.h.

Class Members
union _gc_head * gc_next
union _gc_head * gc_prev
Py_ssize_t gc_refs

Define Documentation

#define _Py_AS_GC (   o)    ((PyGC_Head *)(o)-1)

Definition at line 258 of file objimpl.h.

#define _PyGC_REFS_REACHABLE   (-3)

Definition at line 261 of file objimpl.h.

Definition at line 262 of file objimpl.h.

#define _PyGC_REFS_UNTRACKED   (-2)

Definition at line 260 of file objimpl.h.

#define _PyObject_GC_IS_TRACKED (   o)    ((_Py_AS_GC(o))->gc.gc_refs != _PyGC_REFS_UNTRACKED)

Definition at line 291 of file objimpl.h.

Value:

Definition at line 296 of file objimpl.h.

#define _PyObject_GC_TRACK (   o)
Value:
do { \
    PyGC_Head *g = _Py_AS_GC(o); \
    if (g->gc.gc_refs != _PyGC_REFS_UNTRACKED) \
        Py_FatalError("GC object already tracked"); \
    g->gc.gc_refs = _PyGC_REFS_REACHABLE; \
    g->gc.gc_next = _PyGC_generation0; \
    g->gc.gc_prev = _PyGC_generation0->gc.gc_prev; \
    g->gc.gc_prev->gc.gc_next = g; \
    _PyGC_generation0->gc.gc_prev = g; \
    } while (0);

Definition at line 266 of file objimpl.h.

#define _PyObject_GC_UNTRACK (   o)
Value:
do { \
    PyGC_Head *g = _Py_AS_GC(o); \
    assert(g->gc.gc_refs != _PyGC_REFS_UNTRACKED); \
    g->gc.gc_refs = _PyGC_REFS_UNTRACKED; \
    g->gc.gc_prev->gc.gc_next = g->gc.gc_next; \
    g->gc.gc_next->gc.gc_prev = g->gc.gc_prev; \
    g->gc.gc_next = NULL; \
    } while (0);

Definition at line 281 of file objimpl.h.

#define _PyObject_SIZE (   typeobj)    ( (typeobj)->tp_basicsize )

Definition at line 165 of file objimpl.h.

#define _PyObject_VAR_SIZE (   typeobj,
  nitems 
)
Value:
(size_t)                                    \
    ( ( (typeobj)->tp_basicsize +               \
        (nitems)*(typeobj)->tp_itemsize +       \
        (SIZEOF_VOID_P - 1)                     \
      ) & ~(SIZEOF_VOID_P - 1)                  \
    )

Definition at line 181 of file objimpl.h.

#define Py_VISIT (   op)
Value:
do {                                                                \
        if (op) {                                                       \
            int vret = visit((PyObject *)(op), arg);                    \
            if (vret)                                                   \
                return vret;                                            \
        }                                                               \
    } while (0)

Definition at line 319 of file objimpl.h.

Definition at line 138 of file objimpl.h.

Definition at line 139 of file objimpl.h.

#define PyObject_FREE   PyMem_FREE

Definition at line 134 of file objimpl.h.

#define PyObject_GC_New (   type,
  typeobj 
)    ( (type *) _PyObject_GC_New(typeobj) )

Definition at line 308 of file objimpl.h.

#define PyObject_GC_NewVar (   type,
  typeobj,
  n 
)    ( (type *) _PyObject_GC_NewVar((typeobj), (n)) )

Definition at line 310 of file objimpl.h.

#define PyObject_GC_Resize (   type,
  op,
  n 
)    ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) )

Definition at line 242 of file objimpl.h.

#define PyObject_GET_WEAKREFS_LISTPTR (   o)    ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))

Definition at line 332 of file objimpl.h.

#define PyObject_INIT (   op,
  typeobj 
)    ( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )

Definition at line 160 of file objimpl.h.

#define PyObject_INIT_VAR (   op,
  typeobj,
  size 
)    ( Py_SIZE(op) = (size), PyObject_INIT((op), (typeobj)) )

Definition at line 162 of file objimpl.h.

#define PyObject_IS_GC (   o)
Value:
(PyType_IS_GC(Py_TYPE(o)) && \
    (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))

Definition at line 238 of file objimpl.h.

Definition at line 132 of file objimpl.h.

#define PyObject_New (   type,
  typeobj 
)    ( (type *) _PyObject_New(typeobj) )

Definition at line 153 of file objimpl.h.

#define PyObject_NEW (   type,
  typeobj 
)
Value:
( (type *) PyObject_Init( \
    (PyObject *) PyObject_MALLOC( _PyObject_SIZE(typeobj) ), (typeobj)) )

Definition at line 189 of file objimpl.h.

#define PyObject_NEW_VAR (   type,
  typeobj,
  n 
)
Value:
( (type *) PyObject_InitVar( \
      (PyVarObject *) PyObject_MALLOC(_PyObject_VAR_SIZE((typeobj),(n)) ),\
      (typeobj), (n)) )

Definition at line 193 of file objimpl.h.

#define PyObject_NewVar (   type,
  typeobj,
  n 
)    ( (type *) _PyObject_NewVar((typeobj), (n)) )

Definition at line 155 of file objimpl.h.

Definition at line 133 of file objimpl.h.

#define PyType_IS_GC (   t)    PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)

Definition at line 235 of file objimpl.h.

#define PyType_SUPPORTS_WEAKREFS (   t)    ((t)->tp_weaklistoffset > 0)

Definition at line 330 of file objimpl.h.


Typedef Documentation

typedef union _gc_head PyGC_Head

Function Documentation

PyAPI_FUNC ( void )

Definition at line 1904 of file object.c.

PyAPI_FUNC ( PyObject ) [read]

Definition at line 2431 of file pythonrun.c.

{
    return PyRun_FileExFlags(fp, p, s, g, l, c, NULL);
}
PyAPI_FUNC ( Py_ssize_t  ) [read]

Definition at line 2410 of file pythonrun.c.


Variable Documentation

Definition at line 55 of file gcmodule.c.

Definition at line 149 of file objimpl.h.

Definition at line 98 of file objimpl.h.