Skip to content

Commit 403cf02

Browse files
committed
Replace that cymem thing with something simpler.
1 parent 2412466 commit 403cf02

7 files changed

Lines changed: 15 additions & 14276 deletions

File tree

src/hunter/_event.pyx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ from tokenize import TokenError
1010
from tokenize import generate_tokens
1111

1212
from cpython.pythread cimport PyThread_get_thread_ident
13-
from cpython.ref cimport Py_XINCREF
1413
from cpython.ref cimport PyObject
1514
from cython cimport auto_pickle
1615

1716
from ._tracer cimport Tracer
18-
from .vendor._cymem.cymem cimport Pool
1917

2018
from .const import SITE_PACKAGES_PATHS
2119
from .const import SYS_PREFIX_PATHS
@@ -30,17 +28,21 @@ __all__ = 'Event',
3028

3129
cdef object UNSET = object()
3230

33-
cdef Pool mem = Pool()
34-
cdef PyObject** KIND_NAMES = make_kind_names(['call', 'exception', 'line', 'return', 'call', 'exception', 'return'])
35-
36-
cdef inline PyObject** make_kind_names(list strings):
37-
cdef PyObject** array = <PyObject**>mem.alloc(len(strings), sizeof(PyObject*))
38-
cdef object name
39-
for i, string in enumerate(strings):
40-
name = intern(string)
41-
Py_XINCREF(<PyObject*> name)
42-
array[i] = <PyObject*> name
43-
return <PyObject**>array
31+
32+
cdef str CALL = 'call'
33+
cdef str EXCEPTION = 'exception'
34+
cdef str LINE = 'line'
35+
cdef str RETURN = 'return'
36+
37+
cdef const PyObject** KIND_NAMES = [
38+
<PyObject*>CALL,
39+
<PyObject*>EXCEPTION,
40+
<PyObject*>LINE,
41+
<PyObject*>RETURN,
42+
<PyObject*>CALL,
43+
<PyObject*>EXCEPTION,
44+
<PyObject*>RETURN,
45+
]
4446

4547

4648
@auto_pickle(False)

src/hunter/vendor/_cymem/__init__.pxd

Whitespace-only changes.

src/hunter/vendor/_cymem/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/hunter/vendor/_cymem/about.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)