Skip to main content

Configurable memory allocations

Project description

Memory management in NumPy*

Binder PyPI version

*NumPy is a trademark owned by NumFOCUS.

Customize Memory Allocators

Α metaclass is used to override the internal data memory routines. The metaclass has four optional fields:

>>> import ctypes
>>> import numpy_allocator
>>> my = ctypes.CDLL('libmy.so')
>>> class my_allocator(metaclass=numpy_allocator.type):
...     _calloc_ = my.calloc_func
...     _free_ = my.free_func
...     _malloc_ = my.malloc_func
...     _realloc_ = my.realloc_func
...

An example using the allocator

>>> import numpy as np
>>> with my_allocator:
...     a = np.array([1, 2, 3])
...
>>> my_allocator.handles(a)
True

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numpy-allocator-1.1.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

numpy_allocator-1.1.1-cp310-cp310-musllinux_1_1_x86_64.whl (34.9 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

numpy_allocator-1.1.1-cp310-cp310-musllinux_1_1_i686.whl (33.6 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ i686

numpy_allocator-1.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (35.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.12+ x86-64manylinux: glibc 2.5+ x86-64

numpy_allocator-1.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl (34.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.12+ i686manylinux: glibc 2.5+ i686

numpy_allocator-1.1.1-cp39-cp39-musllinux_1_1_x86_64.whl (34.3 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

numpy_allocator-1.1.1-cp39-cp39-musllinux_1_1_i686.whl (33.0 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ i686

numpy_allocator-1.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (35.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64manylinux: glibc 2.5+ x86-64

numpy_allocator-1.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl (33.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ i686manylinux: glibc 2.5+ i686

numpy_allocator-1.1.1-cp38-cp38-musllinux_1_1_x86_64.whl (35.4 kB view details)

Uploaded CPython 3.8musllinux: musl 1.1+ x86-64

numpy_allocator-1.1.1-cp38-cp38-musllinux_1_1_i686.whl (34.1 kB view details)

Uploaded CPython 3.8musllinux: musl 1.1+ i686

numpy_allocator-1.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (36.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64manylinux: glibc 2.5+ x86-64

numpy_allocator-1.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl (34.9 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ i686manylinux: glibc 2.5+ i686

File details

Details for the file numpy-allocator-1.1.1.tar.gz.

File metadata

  • Download URL: numpy-allocator-1.1.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for numpy-allocator-1.1.1.tar.gz
Algorithm Hash digest
SHA256 81c832f6d61d45914f81283a503fe6986e71ee8bf2874cd337047c262e5998ec
MD5 0d44ce10f3342680cdfb1c5b228b2094
BLAKE2b-256 b359d014ca1825dee2b2ceb8014cfbc4cb0ef71b8bedebbaca48adb34935797d

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 931e76133b8655f4869035c77aea887039740a59b1963718ee871712170fe27a
MD5 527df8e21de21b3f3047ace0aab6b401
BLAKE2b-256 2b42941c049fe519805c7238aaa1ffbec629cc08890069a2884e2d402b9e8682

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp310-cp310-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 6f900f202c1e7070722395a008406f2afaef76b05928e245322f75a4b4421fef
MD5 c1a312c004bd4262726fbbe712c76383
BLAKE2b-256 117f10d2ba8bbe7defdc4f1fcaebbdff0db296e7d7724e26de29fce429bac910

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2c46b50d99a6c01029fab60a4c41133817d2acab29feabea5a2e6e7baa2b61fa
MD5 5a99b96bd2c9c65a745080e657785e9b
BLAKE2b-256 ad9e2af231b46550b58536b8c6e648b742a939105af13462c7d3e1a36459b67d

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 5c90c62c49045bc2d33b13b8ca65358a0b10b0fcfe27c2487ff5c03bd020ca87
MD5 e807f8e77b158f4441fe90930dd6b6d0
BLAKE2b-256 e81574f7f1e201c7b5dc4ba1639daecad3fe72761896b87455816bd3a33b4572

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 f3c04439b2c240c39eee89e7481a6483610163c049a6daf4663b244d45675e9b
MD5 86b80274d0e44fc2f3a8b1a5150ff0e9
BLAKE2b-256 fafd39c6d42a6d192625050c9400de46411c602bd43a25e8e7e3d6a1f80071b2

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp39-cp39-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp39-cp39-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 144a6e1a3d57371951829610359def50d46ad2826dde1beef20acd87e913d330
MD5 2027cdf4d6116c9298d62098b5aba5c3
BLAKE2b-256 c5e646221f51ab250ab4cbedd34aaf5f8acaec9f3b8a519f0f8374290a14ac9d

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ffe6ca931bc33e3b956b3a17b23f96386dce14f1413b1721a685e11aa61346c3
MD5 49fa6a20ee98e113979182f1273d7cb4
BLAKE2b-256 486e43ffddf9302714adc7b8676cdfc03408054b4a501c551bbea1dacacbe430

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 510ca6d274f3b2ec446cac2d95fb45ac950ee4bd13708e537ac5257ce8a47d39
MD5 a94283bd305549d1ea9762bef4c2ce6c
BLAKE2b-256 56095bed342f1e07323725ce3218d14106f121adb35ccdd55fb6faade9d2dc5e

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp38-cp38-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 6b1a7b88f53162343cba3e375f80c2834881312d521d4b916e1b9abbe78cdaed
MD5 6c671f58452030eb82338c6da4d0f034
BLAKE2b-256 baee7a851f60b340bafabd676bb9f860b0fc0e5d61c9e3cb9c64984ec95c7c5a

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp38-cp38-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp38-cp38-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 2c7ca5502e09214940c5df259da438f028c5114b5d83321689f63e60a1057b41
MD5 7ec62f3b80798e9feef8c35754b40963
BLAKE2b-256 fd70b9f9eb5332073fb8cf3a1df3fd855f76be1453aede5595b684d017a96ba2

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 dabb53f5777737f05e801b5d51179503f91af343b25d2826e00caddfc64100a7
MD5 e5880c590f3f89b430f33b746a70d517
BLAKE2b-256 2f8df537795d12b764a09c218e11b9db152350a94417ad994dfaeaffa7661cd5

See more details on using hashes here.

File details

Details for the file numpy_allocator-1.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for numpy_allocator-1.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 9eac49b48f1aa18d95216c3b01e3133c537bccc6b2267625de13febb342b70ec
MD5 ec98fc5f41d7a9c3234aa49801e84abd
BLAKE2b-256 b209c5d5f5a860c6cd56883d473ade1ab74d290c2f2a4ac39da1933f2cd26a1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page