提交 e08a7c16 authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #6440 from notoraptor/fix-memory-leak-fallback-sdot

Fix memory leak in fallback sdot
...@@ -1033,7 +1033,7 @@ def openblas_threads_text(): ...@@ -1033,7 +1033,7 @@ def openblas_threads_text():
def blas_header_version(): def blas_header_version():
# Version for the base header # Version for the base header
version = (5,) version = (7,)
if detect_macos_sdot_bug(): if detect_macos_sdot_bug():
if detect_macos_sdot_bug.fix_works: if detect_macos_sdot_bug.fix_works:
# Version with fix # Version with fix
......
...@@ -305,9 +305,12 @@ void %(precision)sgemv_( ...@@ -305,9 +305,12 @@ void %(precision)sgemv_(
// Compute matrix product: (1, N) * (N, 1) => (1, 1) // Compute matrix product: (1, N) * (N, 1) => (1, 1)
PyArray_MatrixProduct2(vector_x, vector_y, dot_product); PyArray_MatrixProduct2(vector_x, vector_y, dot_product);
// PyArray_MatrixProduct2 adds an extra reference to the output array.
Py_XDECREF(dot_product);
if (PyErr_Occurred()) if (PyErr_Occurred())
alt_fatal_error("NumPy %(precision)sdot_ implementation: unable to compute dot."); alt_fatal_error("NumPy %(precision)sdot_ implementation: unable to compute dot.");
// Get result.
Py_XDECREF(dot_product); Py_XDECREF(dot_product);
Py_XDECREF(vector_y); Py_XDECREF(vector_y);
Py_XDECREF(vector_x); Py_XDECREF(vector_x);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论