Configurable memory allocations
Project description
Memory management in NumPy*
*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 ctypes.util
>>> import numpy_allocator
>>> my = ctypes.CDLL(ctypes.util.find_library('my'))
>>> class my_allocator(metaclass=numpy_allocator.type):
... _calloc_ = ctypes.addressof(my.calloc_func)
... _free_ = ctypes.addressof(my.free_func)
... _malloc_ = ctypes.addressof(my.malloc_func)
... _realloc_ = ctypes.addressof(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.2.0.tar.gz
(11.0 kB
view hashes)
Built Distributions
Close
Hashes for numpy_allocator-1.2.0-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 725870c4ca41bacddf49eda169a7c9d05232cc696b188b8501b80696395f250e |
|
MD5 | 7aa7e78a5df9bc88dfa5c29adf40e84d |
|
BLAKE2b-256 | 86380fc69ee75fa7e67b0cb82149260566d8ae26fcebe406c3a15772b1b2804a |
Close
Hashes for numpy_allocator-1.2.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 263c296e3a2f0d5f3952154c8d3fb2e1a374dabea1d49d02c89823905021ae40 |
|
MD5 | a8c2c2e0af0a8eb21cc7126b23fbee7b |
|
BLAKE2b-256 | bc9c48827bf3cd2ff000ad117fab6e8aebf77dd09311f4d53665f3b1d2db6eae |
Close
Hashes for numpy_allocator-1.2.0-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ff1f7fa425bf9e94861e8a716c3a9bfc32f9117eb92820b654e07b8e288a7f2 |
|
MD5 | b6663420b6f6e6fed2da481073dd26f5 |
|
BLAKE2b-256 | 3fb8da0104de393adb6e182d0b0d4b2ba7260be62530dfc0137d322bbfae5cfc |
Close
Hashes for numpy_allocator-1.2.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b29184a7b355177b7aeb60cf0019e6cfab25a580d1f7636ee32a5020be00adb5 |
|
MD5 | 97e569f93a637a9aacd453152cb455d8 |
|
BLAKE2b-256 | b4072ce734aac5c613e227ad54f7e4093b50acee7b750f20cc93a761d4d77caa |
Close
Hashes for numpy_allocator-1.2.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406ed74162838cd3fbdac62938d0dd773a516e2abfd666be4f3aedc2d8083372 |
|
MD5 | fcd8488cf631f1e3c71fa7848f90a19f |
|
BLAKE2b-256 | 01c5cf03ae458a1ec4a41aea073dd2db42b91b2fa7344b53fa773851880f39c3 |
Close
Hashes for numpy_allocator-1.2.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db63c0420c24b181d09ae1175347b4cc2aad33c8d882993d7250a8eb063273cb |
|
MD5 | f376308d5c7d1a1a3c873623d289bed6 |
|
BLAKE2b-256 | 7b2237bb7ecc157f87e40d4865958fd643dba95358ec1deacd9cb48b98e461e0 |
Close
Hashes for numpy_allocator-1.2.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a68aa89ac7395e36bb3d0a866e9ea2daf17c70a7f2b2df3616878a38ab36a680 |
|
MD5 | 97bfc0a890b19c96576b76c6c33c3334 |
|
BLAKE2b-256 | 4af680959ac1bd31c38b00bc28e21649bc86e411a4db6053ba0cee447048f165 |
Close
Hashes for numpy_allocator-1.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69338a0476cf338689a6789a69f7881c20d230a226b6ec647dd5761a6ddf01e9 |
|
MD5 | 9c45ffb0e1e0035106accbffc6aa90d5 |
|
BLAKE2b-256 | 65454e1c8527e3569a64973e098bf2e4b6b1cfc2230587b33c2c497c5f87bf5e |
Close
Hashes for numpy_allocator-1.2.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caec0c4b4304027f6fc974a2efcf458dcd5a2691d6ed136e6ed90dfa098c987e |
|
MD5 | 46d13d90fed006bdd3610ef7b43a7bf5 |
|
BLAKE2b-256 | 533997e14ee9d7112d5d07e1b2fff8da5cca98289e1b09e42c6f1379dbf4f1fa |
Close
Hashes for numpy_allocator-1.2.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1577ffa3b20972c3bdd0c73e574061791f306e54a56f75eda367ab73316534d |
|
MD5 | 4b486352933c210fcdae2bd816437d5d |
|
BLAKE2b-256 | bf9e9f36455af2fcde3ab7bcd2c2659d981dcc1a96030de6e8c131b8140a3e91 |
Close
Hashes for numpy_allocator-1.2.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f474cc6c1404bf94db891f2ced168bfdc4707d9363245a0f6854f0cec7c3fe89 |
|
MD5 | 01695ed92fd8cae73cb582ef986f7fc3 |
|
BLAKE2b-256 | 3683f26b62563a688b26c81fdc035cec82b06ab9851e0949f8ee0ae47eb77025 |
Close
Hashes for numpy_allocator-1.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c0531dc8ca2ae14d38d64d810a41f105b4098704e31155f5af9f6d3eb99ede |
|
MD5 | 68f22aac38ad462104ce0432d6b6f139 |
|
BLAKE2b-256 | 9348c02330b33bd4c2898bdc66f1fb8497d3b057f8119fec707949ad50ec7df9 |
Close
Hashes for numpy_allocator-1.2.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e59afab413ebbde7e135fbf580bf09542ad7a23abcc7218c345e6727d6f1341 |
|
MD5 | f44dcc597ea8518073f7f00c7ff9fae9 |
|
BLAKE2b-256 | c157b158745b7df07c3e26c8bf7d43bed489aaeb494eba693e788ad6c1f86895 |
Close
Hashes for numpy_allocator-1.2.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce67930a0e2493cc5540fdea67c3b124b5b75359fb618252c6aaba1f3d9aab2c |
|
MD5 | 457182d85c19924aac019e3bdc9fbe0c |
|
BLAKE2b-256 | da14b0142356a922aedb1a61ba96b7051caf52733e90a567985083ff95b214ea |
Close
Hashes for numpy_allocator-1.2.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcd9407245d3290a743bd42c5fa68b23262d29f8fb7ce43ff2a70b91063408f7 |
|
MD5 | c6555c8b7af2800cef5521bb63eca516 |
|
BLAKE2b-256 | 64f1914aac6761e06470535b5b416cf8a7a7b37d6bc68fb55aba12c776f1e63f |
Close
Hashes for numpy_allocator-1.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff4392d46c6f1663b25bd54739dc7ca239f85168286f8a3c689ff3af5cf285c9 |
|
MD5 | a673829b09f48aedfa2f49188b75ab43 |
|
BLAKE2b-256 | 8ec93e431e3f14c9866e67b2bee457a7286eac3f1152439d648cf2a64d6423c7 |
Close
Hashes for numpy_allocator-1.2.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58437ad20a96847a6b08ce7ad30be1ea778b482a4f34cda9f846e415817d8e5c |
|
MD5 | 8e905ea1bf4fe8a47a77b251a9dfe82f |
|
BLAKE2b-256 | ccd8bae20990ed757e0ef6fc72caac387c6b9d67c5b414a265631234bbdb3372 |
Close
Hashes for numpy_allocator-1.2.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bddb9d42ccbf723f4357671231187ae0309699048e6a16673d7c4db0af75fe8e |
|
MD5 | d2e7f788b04da49ddd4ea309dd4d63dc |
|
BLAKE2b-256 | 4faa4a1c2b13fa70cb832117746cf50225d432e08efac2ad83c54a52dec1fe6b |
Close
Hashes for numpy_allocator-1.2.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14ccc85e6d2ee486c19e0452b8424131a1774570a78e8ad0fae8cfce91b7a483 |
|
MD5 | d584b2834a961d82a086fdd6ad1e3663 |
|
BLAKE2b-256 | c0aa0714b014726c7eee47fdea4b487abd1c631b7dd98a79e64b36fb89f973f8 |
Close
Hashes for numpy_allocator-1.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1daef6bb1802003e3a5dc95e31eabb992ee073ca3965f172981fe5daeb5e1b0a |
|
MD5 | c0c7dc005fadb682bf9f78cf1c4dc4fc |
|
BLAKE2b-256 | 24fa7d998ebdf2877c62e19cbf76289511f69f5ab8c0fffcbd59fb9fa5eb4594 |