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