summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2013-05-26 17:03:51 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2013-05-28 20:27:34 +0200
commitfae8369fba4a683783280b044915b11bbca07a44 (patch)
tree0551c9f7fecb1f6ecaab6937a3c9d79f5ffcc20b /numpy/core/numeric.py
parent91ba6d616b528a60e6bdcc4c922b29f8173406aa (diff)
downloadnumpy-fae8369fba4a683783280b044915b11bbca07a44.tar.gz
ENH: implement may_share_memory in C
memmap needs to call it in __array_finalize__ to determine if it can drop the references on copies. The python version if may_share_memory caused significant slowdowns when slicing these maps. closes gh-3364
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index a187d7c5b..bb2f3d28d 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -40,7 +40,7 @@ __all__ = ['newaxis', 'ndarray', 'flatiter', 'nditer', 'nested_iters', 'ufunc',
'Inf', 'inf', 'infty', 'Infinity',
'nan', 'NaN', 'False_', 'True_', 'bitwise_not',
'CLIP', 'RAISE', 'WRAP', 'MAXDIMS', 'BUFSIZE', 'ALLOW_THREADS',
- 'ComplexWarning']
+ 'ComplexWarning', 'may_share_memory']
if sys.version_info[0] < 3:
__all__.extend(['getbuffer', 'newbuffer'])
@@ -252,6 +252,7 @@ fromstring = multiarray.fromstring
fromiter = multiarray.fromiter
fromfile = multiarray.fromfile
frombuffer = multiarray.frombuffer
+may_share_memory = multiarray.may_share_memory
if sys.version_info[0] < 3:
newbuffer = multiarray.newbuffer
getbuffer = multiarray.getbuffer