Lines Matching defs:list

10 /* Overallocate the initial list to reduce the number of reallocs for small

28 if (PyList_Append(list, sub)) { \
41 PyList_SET_ITEM(list, count, sub); \
43 if (PyList_Append(list, sub)) { \
53 /* Always force the list to the expected size. */
54 #define FIX_PREALLOC_SIZE(list) Py_SIZE(list) = count
62 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
65 if (list == NULL)
78 /* No whitespace in str_obj, so just use it as list[0] */
80 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
96 FIX_PREALLOC_SIZE(list);
97 return list;
100 Py_DECREF(list);
111 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
114 if (list == NULL)
130 /* ch not in str_obj, so just use str_obj as list[0] */
132 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
139 FIX_PREALLOC_SIZE(list);
140 return list;
143 Py_DECREF(list);
154 PyObject *list, *sub;
163 list = PyList_New(PREALLOC_SIZE(maxcount));
164 if (list == NULL)
178 /* No match in str_obj, so just use it as list[0] */
180 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
187 FIX_PREALLOC_SIZE(list);
188 return list;
191 Py_DECREF(list);
201 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
204 if (list == NULL)
217 /* No whitespace in str_obj, so just use it as list[0] */
219 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
235 FIX_PREALLOC_SIZE(list);
236 if (PyList_Reverse(list) < 0)
238 return list;
241 Py_DECREF(list);
252 PyObject *list = PyList_New(PREALLOC_SIZE(maxcount));
255 if (list == NULL)
270 /* ch not in str_obj, so just use str_obj as list[0] */
272 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
279 FIX_PREALLOC_SIZE(list);
280 if (PyList_Reverse(list) < 0)
282 return list;
285 Py_DECREF(list);
296 PyObject *list, *sub;
305 list = PyList_New(PREALLOC_SIZE(maxcount));
306 if (list == NULL)
319 /* No match in str_obj, so just use it as list[0] */
321 PyList_SET_ITEM(list, 0, (PyObject *)str_obj);
328 FIX_PREALLOC_SIZE(list);
329 if (PyList_Reverse(list) < 0)
331 return list;
334 Py_DECREF(list);
343 /* This does not use the preallocated list because splitlines is
353 PyObject *list = PyList_New(0);
356 if (list == NULL)
378 /* No linebreak in str_obj, so just use it as list[0] */
379 if (PyList_Append(list, str_obj))
387 return list;
390 Py_DECREF(list);