diff options
author | Georg Brandl <georg@python.org> | 2008-01-12 13:47:57 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-01-12 13:47:57 (GMT) |
commit | 27e26ec4181db395deac30bac09bde1fe3e0fc2b (patch) | |
tree | 8cb1f85b4a8d1cf85d033d0b95c6c0e2a41b0793 /Include/object.h | |
parent | 57fe0f29028d819fdf28dbe0e1e4dd1aa7e727aa (diff) | |
download | cpython-27e26ec4181db395deac30bac09bde1fe3e0fc2b.zip cpython-27e26ec4181db395deac30bac09bde1fe3e0fc2b.tar.gz cpython-27e26ec4181db395deac30bac09bde1fe3e0fc2b.tar.bz2 |
Patch #1700288: Method cache optimization, by Armin Rigo, ported to
2.6 by Kevin Jacobs.
Diffstat (limited to 'Include/object.h')
-rw-r--r-- | Include/object.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h index b434a21..7294158 100644 --- a/Include/object.h +++ b/Include/object.h @@ -345,6 +345,9 @@ typedef struct _typeobject { PyObject *tp_weaklist; destructor tp_del; + /* Type attribute cache version tag. Added in version 2.6 */ + unsigned int tp_version_tag; + #ifdef COUNT_ALLOCS /* these must be last and never explicitly initialized */ Py_ssize_t tp_allocs; @@ -529,6 +532,10 @@ given type object has a specified feature. /* Objects support nb_index in PyNumberMethods */ #define Py_TPFLAGS_HAVE_INDEX (1L<<17) +/* Objects support type attribute cache */ +#define Py_TPFLAGS_HAVE_VERSION_TAG (1L<<18) +#define Py_TPFLAGS_VALID_VERSION_TAG (1L<<19) + /* These flags are used to determine if a type is a subclass. */ #define Py_TPFLAGS_INT_SUBCLASS (1L<<23) #define Py_TPFLAGS_LONG_SUBCLASS (1L<<24) @@ -550,6 +557,7 @@ given type object has a specified feature. Py_TPFLAGS_HAVE_CLASS | \ Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \ Py_TPFLAGS_HAVE_INDEX | \ + Py_TPFLAGS_HAVE_VERSION_TAG | \ 0) #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) |