Low-level memory allocation functions¶
TESTS:
Check that a MemoryError
is raised if we try to allocate a
ridiculously large integer, see trac ticket #15363:
sage: 2^(2^63-2)
Traceback (most recent call last):
...
RuntimeError: exponent must be at most 2147483647 # 32-bit
MemoryError: failed to allocate 1152921504606847008 bytes # 64-bit
AUTHORS:
- Jeroen Demeyer (2011-01-13): initial version (trac ticket #10258)
- Jeroen Demeyer (2014-12-14): add more functions (trac ticket #10257)
- Jeroen Demeyer (2015-03-02): move from
c_lib
to Cython (trac ticket #17881)
-
sage.ext.memory.
init_memory_functions
()¶ Set the MPIR/GMP memory functions to the above functions.
EXAMPLES:
sage: from sage.ext.memory import init_memory_functions sage: init_memory_functions()