Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Include/dictobject.h

    r2 r388  
    4949
    5050typedef struct {
    51         /* Cached hash code of me_key.  Note that hash codes are C longs.
    52         * We have to use Py_ssize_t instead because dict_popitem() abuses
    53         * me_hash to hold a search finger.
    54         */
    55         Py_ssize_t me_hash;
    56         PyObject *me_key;
    57         PyObject *me_value;
     51    /* Cached hash code of me_key.  Note that hash codes are C longs.
     52    * We have to use Py_ssize_t instead because dict_popitem() abuses
     53    * me_hash to hold a search finger.
     54    */
     55    Py_ssize_t me_hash;
     56    PyObject *me_key;
     57    PyObject *me_value;
    5858} PyDictEntry;
    5959
     
    6969typedef struct _dictobject PyDictObject;
    7070struct _dictobject {
    71         PyObject_HEAD
    72         Py_ssize_t ma_fill;  /* # Active + # Dummy */
    73         Py_ssize_t ma_used;  /* # Active */
     71    PyObject_HEAD
     72    Py_ssize_t ma_fill;  /* # Active + # Dummy */
     73    Py_ssize_t ma_used;  /* # Active */
    7474
    75         /* The table contains ma_mask + 1 slots, and that's a power of 2.
    76         * We store the mask instead of the size because the mask is more
    77         * frequently needed.
    78         */
    79         Py_ssize_t ma_mask;
     75    /* The table contains ma_mask + 1 slots, and that's a power of 2.
     76    * We store the mask instead of the size because the mask is more
     77    * frequently needed.
     78    */
     79    Py_ssize_t ma_mask;
    8080
    81         /* ma_table points to ma_smalltable for small tables, else to
    82         * additional malloc'ed memory.  ma_table is never NULL!  This rule
    83         * saves repeated runtime null-tests in the workhorse getitem and
    84         * setitem calls.
    85         */
    86         PyDictEntry *ma_table;
    87         PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash);
    88         PyDictEntry ma_smalltable[PyDict_MINSIZE];
     81    /* ma_table points to ma_smalltable for small tables, else to
     82    * additional malloc'ed memory.  ma_table is never NULL!  This rule
     83    * saves repeated runtime null-tests in the workhorse getitem and
     84    * setitem calls.
     85    */
     86    PyDictEntry *ma_table;
     87    PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, long hash);
     88    PyDictEntry ma_smalltable[PyDict_MINSIZE];
    8989};
    9090
    9191PyAPI_DATA(PyTypeObject) PyDict_Type;
     92PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
     93PyAPI_DATA(PyTypeObject) PyDictIterValue_Type;
     94PyAPI_DATA(PyTypeObject) PyDictIterItem_Type;
     95PyAPI_DATA(PyTypeObject) PyDictKeys_Type;
     96PyAPI_DATA(PyTypeObject) PyDictItems_Type;
     97PyAPI_DATA(PyTypeObject) PyDictValues_Type;
    9298
    9399#define PyDict_Check(op) \
    94100                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
    95101#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
     102#define PyDictKeys_Check(op) (Py_TYPE(op) == &PyDictKeys_Type)
     103#define PyDictItems_Check(op) (Py_TYPE(op) == &PyDictItems_Type)
     104#define PyDictValues_Check(op) (Py_TYPE(op) == &PyDictValues_Type)
     105/* This excludes Values, since they are not sets. */
     106# define PyDictViewSet_Check(op) \
     107    (PyDictKeys_Check(op) || PyDictItems_Check(op))
    96108
    97109PyAPI_FUNC(PyObject *) PyDict_New(void);
     
    101113PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
    102114PyAPI_FUNC(int) PyDict_Next(
    103         PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
     115    PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
    104116PyAPI_FUNC(int) _PyDict_Next(
    105         PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, long *hash);
     117    PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, long *hash);
    106118PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp);
    107119PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
     
    112124PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, long hash);
    113125PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused);
     126PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
    114127
    115128/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
     
    122135*/
    123136PyAPI_FUNC(int) PyDict_Merge(PyObject *mp,
    124                                    PyObject *other,
    125                                    int override);
     137                                   PyObject *other,
     138                                   int override);
    126139
    127140/* PyDict_MergeFromSeq2 updates/merges from an iterable object producing
     
    131144*/
    132145PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d,
    133                                            PyObject *seq2,
    134                                            int override);
     146                                           PyObject *seq2,
     147                                           int override);
    135148
    136149PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key);
Note: See TracChangeset for help on using the changeset viewer.