Commit 72f37449 authored by Georg Brandl's avatar Georg Brandl

#2963: fix method cache types.

parent 3d9cddfe
...@@ -12,6 +12,8 @@ What's new in Python 3.0b1? ...@@ -12,6 +12,8 @@ What's new in Python 3.0b1?
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #2963: fix merging oversight that disabled method cache for all types.
- Issue #2964: fix a missing INCREF in instancemethod_descr_get. - Issue #2964: fix a missing INCREF in instancemethod_descr_get.
- Issue 2895: Don't crash when given bytes objects as keyword names. - Issue 2895: Don't crash when given bytes objects as keyword names.
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
>> (8*sizeof(unsigned int) - MCACHE_SIZE_EXP)) >> (8*sizeof(unsigned int) - MCACHE_SIZE_EXP))
#define MCACHE_HASH_METHOD(type, name) \ #define MCACHE_HASH_METHOD(type, name) \
MCACHE_HASH((type)->tp_version_tag, \ MCACHE_HASH((type)->tp_version_tag, \
((PyStringObject *)(name))->ob_shash) ((PyUnicodeObject *)(name))->hash)
#define MCACHE_CACHEABLE_NAME(name) \ #define MCACHE_CACHEABLE_NAME(name) \
PyString_CheckExact(name) && \ PyUnicode_CheckExact(name) && \
PyString_GET_SIZE(name) <= MCACHE_MAX_ATTR_SIZE PyUnicode_GET_SIZE(name) <= MCACHE_MAX_ATTR_SIZE
struct method_cache_entry { struct method_cache_entry {
unsigned int version; unsigned int version;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment