Changeset 391 for python/trunk/Include/setobject.h
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Include/setobject.h
r2 r391 23 23 24 24 typedef struct { 25 26 25 long hash; /* cached hash code for the entry key */ 26 PyObject *key; 27 27 } setentry; 28 28 … … 34 34 typedef struct _setobject PySetObject; 35 35 struct _setobject { 36 36 PyObject_HEAD 37 37 38 39 38 Py_ssize_t fill; /* # Active + # Dummy */ 39 Py_ssize_t used; /* # Active */ 40 40 41 42 43 44 45 41 /* The table contains mask + 1 slots, and that's a power of 2. 42 * We store the mask instead of the size because the mask is more 43 * frequently needed. 44 */ 45 Py_ssize_t mask; 46 46 47 48 49 50 51 52 53 47 /* table points to smalltable for small tables, else to 48 * additional malloc'ed memory. table is never NULL! This rule 49 * saves repeated runtime null-tests. 50 */ 51 setentry *table; 52 setentry *(*lookup)(PySetObject *so, PyObject *key, long hash); 53 setentry smalltable[PySet_MINSIZE]; 54 54 55 long hash;/* only used by frozenset objects */56 PyObject *weakreflist;/* List of weak references */55 long hash; /* only used by frozenset objects */ 56 PyObject *weakreflist; /* List of weak references */ 57 57 }; 58 58 … … 69 69 #define PyFrozenSet_CheckExact(ob) (Py_TYPE(ob) == &PyFrozenSet_Type) 70 70 #define PyAnySet_CheckExact(ob) \ 71 71 (Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type) 72 72 #define PyAnySet_Check(ob) \ 73 74 75 73 (Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type || \ 74 PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \ 75 PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type)) 76 76 #define PySet_Check(ob) \ 77 78 77 (Py_TYPE(ob) == &PySet_Type || \ 78 PyType_IsSubtype(Py_TYPE(ob), &PySet_Type)) 79 79 #define PyFrozenSet_Check(ob) \ 80 81 80 (Py_TYPE(ob) == &PyFrozenSet_Type || \ 81 PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type)) 82 82 83 83 PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
Note:
See TracChangeset
for help on using the changeset viewer.