Lines Matching refs:acc
18 _PyAccu_Init(_PyAccu *acc)
21 acc->large = NULL;
22 acc->small = PyList_New(0);
23 if (acc->small == NULL)
29 flush_accumulator(_PyAccu *acc)
31 Py_ssize_t nsmall = PyList_GET_SIZE(acc->small);
35 if (acc->large == NULL) {
36 acc->large = PyList_New(0);
37 if (acc->large == NULL)
40 joined = join_list_unicode(acc->small);
43 if (PyList_SetSlice(acc->small, 0, nsmall, NULL)) {
47 ret = PyList_Append(acc->large, joined);
55 _PyAccu_Accumulate(_PyAccu *acc, PyObject *unicode)
60 if (PyList_Append(acc->small, unicode))
62 nsmall = PyList_GET_SIZE(acc->small);
72 return flush_accumulator(acc);
76 _PyAccu_FinishAsList(_PyAccu *acc)
81 ret = flush_accumulator(acc);
82 Py_CLEAR(acc->small);
84 Py_CLEAR(acc->large);
87 res = acc->large;
88 acc->large = NULL;
93 _PyAccu_Finish(_PyAccu *acc)
96 if (acc->large == NULL) {
97 list = acc->small;
98 acc->small = NULL;
101 list = _PyAccu_FinishAsList(acc);
111 _PyAccu_Destroy(_PyAccu *acc)
113 Py_CLEAR(acc->small);
114 Py_CLEAR(acc->large);