File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,6 @@ along with Sequali. If not, see <https://www.gnu.org/licenses/
32
32
#include "emmintrin.h"
33
33
#endif
34
34
35
- #if (PY_VERSION_HEX < 0x03090000 )
36
- #define Py_SET_REFCNT (op , count ) (Py_REFCNT(op) = count)
37
- #define Py_SET_SIZE (op , size ) (Py_SIZE(op) = size)
38
- #define Py_SET_TYPE (op , type ) (Py_TYPE(op) = type)
39
- #endif
40
-
41
35
/* Pointers to types that will be imported in the module initialization section */
42
36
43
37
static PyTypeObject * PythonArray ; // array.array
@@ -538,14 +532,11 @@ FastqRecordArrayView_FromPointerSizeAndObject(struct FastqMeta *records,
538
532
PyObject * obj )
539
533
{
540
534
size_t size = number_of_records * sizeof (struct FastqMeta );
541
- FastqRecordArrayView * self =
542
- PyObject_Malloc ( sizeof ( FastqRecordArrayView ) + size );
535
+ FastqRecordArrayView * self = PyObject_NewVar (
536
+ FastqRecordArrayView , & FastqRecordArrayView_Type , number_of_records );
543
537
if (self == NULL ) {
544
538
return PyErr_NoMemory ();
545
539
}
546
- Py_SET_REFCNT (self , 1 );
547
- Py_SET_TYPE (self , & FastqRecordArrayView_Type );
548
- Py_SET_SIZE (self , number_of_records );
549
540
if (records != NULL ) {
550
541
memcpy (self -> records , records , size );
551
542
}
You can’t perform that action at this time.
0 commit comments