Lines Matching refs:co
2600 combinationsobject *co;
2625 co = (combinationsobject *)type->tp_alloc(type, 0);
2626 if (co == NULL)
2629 co->pool = pool;
2630 co->indices = indices;
2631 co->result = NULL;
2632 co->r = r;
2633 co->stopped = r > n ? 1 : 0;
2635 return (PyObject *)co;
2645 combinations_dealloc(combinationsobject *co)
2647 PyObject_GC_UnTrack(co);
2648 Py_XDECREF(co->pool);
2649 Py_XDECREF(co->result);
2650 if (co->indices != NULL)
2651 PyMem_Free(co->indices);
2652 Py_TYPE(co)->tp_free(co);
2656 combinations_sizeof(combinationsobject *co, void *unused)
2660 res = _PyObject_SIZE(Py_TYPE(co));
2661 res += co->r * sizeof(Py_ssize_t);
2666 combinations_traverse(combinationsobject *co, visitproc visit, void *arg)
2668 Py_VISIT(co->pool);
2669 Py_VISIT(co->result);
2674 combinations_next(combinationsobject *co)
2678 PyObject *pool = co->pool;
2679 Py_ssize_t *indices = co->indices;
2680 PyObject *result = co->result;
2682 Py_ssize_t r = co->r;
2685 if (co->stopped)
2693 co->result = result;
2707 co->result = result;
2755 co->stopped = 1;
2937 cwrobject *co;
2962 co = (cwrobject *)type->tp_alloc(type, 0);
2963 if (co == NULL)
2966 co->pool = pool;
2967 co->indices = indices;
2968 co->result = NULL;
2969 co->r = r;
2970 co->stopped = !n && r;
2972 return (PyObject *)co;
2982 cwr_dealloc(cwrobject *co)
2984 PyObject_GC_UnTrack(co);
2985 Py_XDECREF(co->pool);
2986 Py_XDECREF(co->result);
2987 if (co->indices != NULL)
2988 PyMem_Free(co->indices);
2989 Py_TYPE(co)->tp_free(co);
2993 cwr_sizeof(cwrobject *co, void *unused)
2997 res = _PyObject_SIZE(Py_TYPE(co));
2998 res += co->r * sizeof(Py_ssize_t);
3003 cwr_traverse(cwrobject *co, visitproc visit, void *arg)
3005 Py_VISIT(co->pool);
3006 Py_VISIT(co->result);
3011 cwr_next(cwrobject *co)
3015 PyObject *pool = co->pool;
3016 Py_ssize_t *indices = co->indices;
3017 PyObject *result = co->result;
3019 Py_ssize_t r = co->r;
3022 if (co->stopped)
3030 co->result = result;
3046 co->result = result;
3086 co->stopped = 1;