Skip to content

Commit 4b88d62

Browse files
committed
mark _mkl_memory free-threading compatible
1 parent 910d982 commit 4b88d62

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎mkl/_mkl_memory.pyx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, Intel Corporation
1+
# Copyright (c) 2026, Intel Corporation
22
#
33
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions are met:
@@ -25,6 +25,7 @@
2525

2626
# distutils: language = c
2727
# cython: language_level=3
28+
# cython: freethreading_compatible=True
2829

2930
import numbers
3031

@@ -163,16 +164,16 @@ cdef class MKLMemory:
163164

164165
def __getbuffer__(self, Py_buffer *buffer, int flags):
165166
buffer.buf = <void *>self._memory_ptr
166-
buffer.format = "B" # byte
167-
buffer.internal = NULL # see References
167+
buffer.format = "B"
168+
buffer.internal = NULL
168169
buffer.itemsize = 1
169170
buffer.len = self.nbytes
170171
buffer.ndim = 1
171172
buffer.obj = self
172173
buffer.readonly = 0
173174
buffer.shape = &self.nbytes
174175
buffer.strides = &buffer.itemsize
175-
buffer.suboffsets = NULL # for pointer arrays only
176+
buffer.suboffsets = NULL
176177

177178
atomic_fetch_add(&self.exported_buffers, 1)
178179

0 commit comments

Comments
 (0)