File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 23
23
// (`LIBPY_COMPILING_FOR_TESTS`) which will control the `NO_IMPORT_ARRAY` flag. This flag
24
24
// tells numpy to declare the `PyArray_API` flag as an `extern "C" void** PyArray_API`,
25
25
// meaning we expect to have this symbol defined by another object we are to be linked
26
- // with. In `main.cc` we also set `LIBPY_MAIN ` to disable this feature, but instead define
27
- // `PY_ARRAY_UNIQUE_SYMBOL` which causes changes the declaration of `PyArray_API` to
28
- // change to: `#define PyArray_API PY_ARRAY_UNIQUE_SYMBOL` and then `void**
26
+ // with. In `main.cc` we also set `LIBPY_TEST_MAIN ` to disable this feature, but instead
27
+ // define `PY_ARRAY_UNIQUE_SYMBOL` which causes changes the declaration of `PyArray_API`
28
+ // to change to: `#define PyArray_API PY_ARRAY_UNIQUE_SYMBOL` and then `void**
29
29
// PyArray_API`. Importantly, this removes the `static` causing the symbol to have
30
30
// external linkage. Then, because the tests are declaring the same symbol as extern, they
31
31
// will all resolve to the same `PyArray_API` instance and we only need to call
32
32
// `import_array` once in `main.cc`.
33
- #if defined(LIBPY_COMPILING_FOR_TESTS) && !defined(LIBPY_MAIN )
33
+ #if defined(LIBPY_COMPILING_FOR_TESTS) && !defined(LIBPY_TEST_MAIN )
34
34
#define NO_IMPORT_ARRAY
35
35
#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_libpy
36
36
#endif
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ leak:_ctypes.cpython
5
5
leak:_ctypes.x86_64-linux-gnu.so
6
6
leak:numpy/core/src/multiarray/arraytypes.c.src
7
7
leak:numpy/core/src/multiarray/alloc.c
8
- leak:numpy/core/src/multiarray/ctors.c
8
+ leak:numpy/core/src/multiarray/ctors.c
Original file line number Diff line number Diff line change 1
1
#include " gtest/gtest.h"
2
2
#include < Python.h>
3
3
4
- #define LIBPY_MAIN
4
+ #define LIBPY_TEST_MAIN
5
5
#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API_libpy
6
6
#include " libpy/numpy_utils.h"
7
7
You can’t perform that action at this time.
0 commit comments