Index index by Group index by Distribution index by Vendor index by creation date index by Name Mirrors Help Search

python312-cymem-2.0.11-1.3 RPM for x86_64

From OpenSuSE Tumbleweed for x86_64

Name: python312-cymem Distribution: openSUSE Tumbleweed
Version: 2.0.11 Vendor: openSUSE
Release: 1.3 Build date: Wed Jan 22 04:07:56 2025
Group: Unspecified Build host: reproducible
Size: 136678 Source RPM: python-cymem-2.0.11-1.3.src.rpm
Packager: https://bugs.opensuse.org
Url: https://github.com/explosion/cymem
Summary: Manage calls to calloc/free through Cython

cymem provides two small memory-management helpers for Cython. They make it
easy to tie memory to a Python object's life-cycle, so that the memory is freed
when the object is garbage collected.



The most useful is `cymem.Pool`, which acts as a thin wrapper around the calloc
function:

```python
from cymem.cymem cimport Pool
cdef Pool mem = Pool()
data1 = <int*>mem.alloc(10, sizeof(int))
data2 = <float*>mem.alloc(12, sizeof(float))
```

The `Pool` object saves the memory addresses internally, and frees them when the
object is garbage collected. Typically you'll attach the `Pool` to some cdef'd
class. This is particularly handy for deeply nested structs, which have
complicated initialization functions. Just pass the `Pool` object into the
initializer, and you don't have to worry about freeing your struct at all —
all of the calls to `Pool.alloc` will be automatically freed when the `Pool`
expires.

Provides

Requires