python-2.7.11/Include/objimpl.h File Reference

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

Classes

union  _gc_head
 

Macros

#define PyObject_MALLOC   PyObject_Malloc
 
#define PyObject_REALLOC   PyObject_Realloc
 
#define PyObject_FREE   PyObject_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

 __declspec (dllimport) void *PyObject_Malloc(size_t)
 

Variables

 size_t
 
PyTypeObject PyTypeObject Py_ssize_t
 
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
#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
struct _gc_head::@8 gc

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:179
#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) \
)
size_t
Definition: objimpl.h:98
#define SIZEOF_VOID_P
Definition: pyconfig.h:370

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   PyObject_Free

Definition at line 128 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:179
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   PyObject_Malloc

Definition at line 126 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:
( (type *) PyObject_Init( \
(PyObject *) PyObject_MALLOC( _PyObject_SIZE(typeobj) ), (typeobj)) )
int type
Definition: node.h:20
#define PyObject_MALLOC
Definition: objimpl.h:126
#define _PyObject_SIZE(typeobj)
Definition: objimpl.h:168

Definition at line 192 of file objimpl.h.

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

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   PyObject_Realloc

Definition at line 127 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:659
#define Py_TPFLAGS_HAVE_WEAKREFS
Definition: object.h:585

Definition at line 344 of file objimpl.h.

Typedef Documentation

typedef union _gc_head PyGC_Head

Function Documentation

Variable Documentation

PyGC_Head* _PyGC_generation0

Definition at line 152 of file objimpl.h.

size_t

Definition at line 98 of file objimpl.h.

Go to the source code of this file.