python-2.7.6/include/objimpl.h File Reference

objimpl.h File Reference
#include "pymem.h"

Classes

union  _gc_head
 

Macros

#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_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 _PyObject_GC_Del   PyObject_GC_Del
 
#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 PyGC_HEAD_SIZE   0
 
#define PyObject_GC_Init(op)
 
#define PyObject_GC_Fini(op)
 
#define PyObject_AS_GC(op)   (op)
 
#define PyObject_FROM_GC(op)   (op)
 
#define PyType_SUPPORTS_WEAKREFS(t)
 
#define PyObject_GET_WEAKREFS_LISTPTR(o)   ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
 

Typedefs

typedef union _gc_head PyGC_Head
 

Functions

void * PyObject_Malloc (size_t)
 
void * PyObject_Realloc (void *, size_t)
 
void PyObject_Free (void *)
 
PyObjectPyObject_Init (PyObject *, PyTypeObject *)
 
PyVarObjectPyObject_InitVar (PyVarObject *, PyTypeObject *, Py_ssize_t)
 
PyObject_PyObject_New (PyTypeObject *)
 
PyVarObject_PyObject_NewVar (PyTypeObject *, Py_ssize_t)
 
Py_ssize_t PyGC_Collect (void)
 
PyVarObject_PyObject_GC_Resize (PyVarObject *, Py_ssize_t)
 
PyObject_PyObject_GC_Malloc (size_t)
 
PyObject_PyObject_GC_New (PyTypeObject *)
 
PyVarObject_PyObject_GC_NewVar (PyTypeObject *, Py_ssize_t)
 
void PyObject_GC_Track (void *)
 
void PyObject_GC_UnTrack (void *)
 
void PyObject_GC_Del (void *)
 

Variables

PyGC_Head_PyGC_generation0
 

Macro Definition Documentation

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

Definition at line 263 of file objimpl.h.

#define _PyGC_REFS_REACHABLE   (-3)

Definition at line 266 of file objimpl.h.

#define _PyGC_REFS_TENTATIVELY_UNREACHABLE   (-4)

Definition at line 267 of file objimpl.h.

#define _PyGC_REFS_UNTRACKED   (-2)

Definition at line 265 of file objimpl.h.

#define _PyObject_Del   PyObject_Free

Definition at line 142 of file objimpl.h.

#define _PyObject_GC_Del   PyObject_GC_Del

Definition at line 249 of file objimpl.h.

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

Definition at line 296 of file objimpl.h.

#define _PyObject_GC_MAY_BE_TRACKED (   obj)
Value:
#define PyTuple_CheckExact(op)
Definition: tupleobject.h:38
#define PyObject_IS_GC(o)
Definition: objimpl.h:241
#define _PyObject_GC_IS_TRACKED(o)
Definition: objimpl.h:296
PyObject * obj
Definition: abstract.h:1205

Definition at line 301 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->gc.gc_next = g; \
_PyGC_generation0->gc.gc_prev = g; \
} while (0);
union _gc_head * gc_next
Definition: objimpl.h:254
PyGC_Head * _PyGC_generation0
struct _gc_head::@0 gc
#define _Py_AS_GC(o)
Definition: objimpl.h:263
#define _PyGC_REFS_REACHABLE
Definition: objimpl.h:266
#define _PyGC_REFS_UNTRACKED
Definition: objimpl.h:265
PyObject * o
Definition: abstract.h:608
union _gc_head * gc_prev
Definition: objimpl.h:255

Definition at line 271 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);
#define NULL
Definition: kaydara.h:169
#define _Py_AS_GC(o)
Definition: objimpl.h:263
#define _PyGC_REFS_UNTRACKED
Definition: objimpl.h:265
PyObject * o
Definition: abstract.h:608

Definition at line 286 of file objimpl.h.

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

Definition at line 168 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) \
)
#define SIZEOF_VOID_P
PyObject char size_t
Definition: import.h:39

Definition at line 184 of file objimpl.h.

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

Definition at line 324 of file objimpl.h.

#define PyGC_HEAD_SIZE   0

Definition at line 336 of file objimpl.h.

#define PyObject_AS_GC (   op)    (op)

Definition at line 339 of file objimpl.h.

#define PyObject_Del   PyObject_Free

Definition at line 138 of file objimpl.h.

#define PyObject_DEL   PyObject_FREE

Definition at line 139 of file objimpl.h.

#define PyObject_FREE   PyMem_FREE

Definition at line 134 of file objimpl.h.

#define PyObject_FROM_GC (   op)    (op)

Definition at line 340 of file objimpl.h.

#define PyObject_GC_Fini (   op)

Definition at line 338 of file objimpl.h.

#define PyObject_GC_Init (   op)

Definition at line 337 of file objimpl.h.

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

Definition at line 313 of file objimpl.h.

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

Definition at line 315 of file objimpl.h.

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

Definition at line 245 of file objimpl.h.

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

Definition at line 348 of file objimpl.h.

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

Definition at line 163 of file objimpl.h.

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

Definition at line 165 of file objimpl.h.

#define PyObject_IS_GC (   o)
Value:
(Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))
#define PyType_IS_GC(t)
Definition: objimpl.h:238
#define NULL
Definition: kaydara.h:169
PyObject * o
Definition: abstract.h:608
#define Py_TYPE(ob)
Definition: object.h:115

Definition at line 241 of file objimpl.h.

#define PyObject_MALLOC   PyMem_MALLOC

Definition at line 132 of file objimpl.h.

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

Definition at line 156 of file objimpl.h.

#define PyObject_NEW (   type,
  typeobj 
)
Value:
(PyObject *) PyObject_MALLOC( _PyObject_SIZE(typeobj) ), (typeobj)) )
int type
Definition: node.h:20
#define PyObject_MALLOC
Definition: objimpl.h:132
#define _PyObject_SIZE(typeobj)
Definition: objimpl.h:168
PyObject * PyObject_Init(PyObject *, PyTypeObject *)

Definition at line 192 of file objimpl.h.

#define PyObject_NEW_VAR (   type,
  typeobj,
  n 
)
Value:
(typeobj), (n)) )
size_t n
Definition: longobject.h:93
int type
Definition: node.h:20
#define PyObject_MALLOC
Definition: objimpl.h:132
#define _PyObject_VAR_SIZE(typeobj, nitems)
Definition: objimpl.h:184
PyVarObject * PyObject_InitVar(PyVarObject *, PyTypeObject *, Py_ssize_t)

Definition at line 196 of file objimpl.h.

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

Definition at line 158 of file objimpl.h.

#define PyObject_REALLOC   PyMem_REALLOC

Definition at line 133 of file objimpl.h.

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

Definition at line 238 of file objimpl.h.

#define PyType_SUPPORTS_WEAKREFS (   t)
Value:
&& ((t)->tp_weaklistoffset > 0))
#define PyType_HasFeature(t, f)
Definition: object.h:657
#define Py_TPFLAGS_HAVE_WEAKREFS
Definition: object.h:583

Definition at line 344 of file objimpl.h.

Typedef Documentation

typedef union _gc_head PyGC_Head

Function Documentation

PyObject* _PyObject_GC_Malloc ( size_t  )
PyObject* _PyObject_GC_New ( PyTypeObject )
PyVarObject* _PyObject_GC_NewVar ( PyTypeObject ,
Py_ssize_t   
)
PyVarObject* _PyObject_GC_Resize ( PyVarObject ,
Py_ssize_t   
)
PyObject* _PyObject_New ( PyTypeObject )
PyVarObject* _PyObject_NewVar ( PyTypeObject ,
Py_ssize_t   
)
Py_ssize_t PyGC_Collect ( void  )
void PyObject_Free ( void *  )
void PyObject_GC_Del ( void *  )
void PyObject_GC_Track ( void *  )
void PyObject_GC_UnTrack ( void *  )
PyObject* PyObject_Init ( PyObject ,
PyTypeObject  
)
PyVarObject* PyObject_InitVar ( PyVarObject ,
PyTypeObject ,
Py_ssize_t   
)
void* PyObject_Malloc ( size_t  )
void* PyObject_Realloc ( void *  ,
size_t   
)

Variable Documentation

PyGC_Head* _PyGC_generation0

Go to the source code of this file.