diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-07-10 14:50:59 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-07-10 15:00:40 -0600 |
commit | 3e396148edfe91214c7baa03492f523ca53680e8 (patch) | |
tree | 238a359ec429b1a5ff75df1354bca15dab5ee2e8 /numpy/core/fromnumeric.py | |
parent | d3e3d91d401f5e47a81e748cd7fb12620b45947a (diff) | |
download | numpy-3e396148edfe91214c7baa03492f523ca53680e8.tar.gz |
MAINT: Allocate fewer bytes for empty arrays.
Currently the number of bytes allocated is the product of the non-zero
dimensions x element_size, which can create huge memory allocations for
empty arrays. Change that to just allocate enough for one element. Some
allocation is needed for the array.data attribute to work correctly.
Note: Could probably allocate a minimal number of bytes, say 16 as
dictated by alignment, but the old intended number is used here as a
more conservative fix.
Closes #7813.
Diffstat (limited to 'numpy/core/fromnumeric.py')
0 files changed, 0 insertions, 0 deletions