[Python-checkins] CVS: python/dist/src/Include object.h,2.79.2.10,2.79.2.11

Guido van Rossum gvanrossum@users.sourceforge.net
Wed, 06 Jun 2001 07:34:59 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv17822

Modified Files:
      Tag: descr-branch
	object.h 
Log Message:
Add _PyObject_GetDictPtr() -- an internal API to get a pointer to
where __dict__ is stored in an object.  The simplest case is to add
tp_dictoffset to the start of the object, but there are comlications:
tp_flags may tell us that tp_dictoffset is not defined, or the offset
may be negative: indexing from the end of the object, where
tp_itemsize may have to be taken into account.


Index: object.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/object.h,v
retrieving revision 2.79.2.10
retrieving revision 2.79.2.11
diff -C2 -r2.79.2.10 -r2.79.2.11
*** object.h	2001/06/06 14:26:12	2.79.2.10
--- object.h	2001/06/06 14:34:57	2.79.2.11
***************
*** 314,317 ****
--- 314,318 ----
  extern DL_IMPORT(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
  extern DL_IMPORT(int) PyObject_HasAttr(PyObject *, PyObject *);
+ extern DL_IMPORT(PyObject **) _PyObject_GetDictPtr(PyObject *);
  extern DL_IMPORT(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *);
  extern DL_IMPORT(int) PyObject_GenericSetAttr(PyObject *,