Skip to content
Snippets Groups Projects
Commit 0592817c authored by Martin Larralde's avatar Martin Larralde
Browse files

Make `_Map` deallocate the compute map when garbage collected

parent d1e2636c
No related branches found
No related tags found
No related merge requests found
......@@ -287,12 +287,38 @@ cdef int _add_minimizers_prot(
cdef class _Map:
"""A private class wrapping a heap-allocated compute map.
"""
# --- Attributes ---------------------------------------------------------
cdef Map_t* _map
# --- Magic methods ------------------------------------------------------
def __cinit__(self):
self._map = NULL
def __init__(self):
raise TypeError(f"Cannot instantiate objects of type {type(self).__name__!r}")
def __dealloc__(self):
del self._map
cdef class _FinalMappings:
"""A private class wrapping a vector of L2 mapping results.
"""
# --- Attributes ---------------------------------------------------------
cdef atomic_vector[MappingResult_t] _vec
# --- Magic methods ------------------------------------------------------
def __init__(self):
raise TypeError(f"Cannot instantiate objects of type {type(self).__name__!r}")
cdef class _Parameterized:
"""A base class for types wrapping a `skch::Parameters` C++ object.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment