kou opened a new issue, #49295: URL: https://github.com/apache/arrow/issues/49295
### Describe the enhancement requested Because `test_memory.py` always add `"mimalloc"` into `mandatory_backends`: https://github.com/apache/arrow/blob/e2aad46a07db88d91c9c054a805acebb2caaab62/python/pyarrow/tests/test_memory.py#L35 Can we detect it dynamically? For example: ```diff diff --git a/python/pyarrow/src/arrow/python/config.cc b/python/pyarrow/src/arrow/python/config.cc index d664763987..9f3a6a9423 100644 --- a/python/pyarrow/src/arrow/python/config.cc +++ b/python/pyarrow/src/arrow/python/config.cc @@ -25,6 +25,11 @@ namespace { const BuildInfo kBuildInfo = { PYARROW_BUILD_TYPE, +#ifdef ARROW_MIMALLOC + true, +#else + false, +#endif }; } // namespace @@ -32,4 +37,4 @@ const BuildInfo kBuildInfo = { const BuildInfo& GetBuildInfo() { return kBuildInfo; } } // namespace py -} // namespace arrow \ No newline at end of file +} // namespace arrow diff --git a/python/pyarrow/src/arrow/python/config.h b/python/pyarrow/src/arrow/python/config.h index 9af06f2716..fc74451167 100644 --- a/python/pyarrow/src/arrow/python/config.h +++ b/python/pyarrow/src/arrow/python/config.h @@ -27,6 +27,9 @@ namespace py { struct BuildInfo { // The uppercase build type, e.g. "DEBUG" or "RELEASE" std::string build_type; + + // Whether mimalloc support is enabled or not + bool mimalloc_enabled; }; /// \brief Get build info for PyArrow. @@ -35,4 +38,4 @@ ARROW_PYTHON_EXPORT const BuildInfo& GetBuildInfo(); } // namespace py -} // namespace arrow \ No newline at end of file +} // namespace arrow diff --git a/python/pyarrow/src/arrow/python/config_internal.h.cmake b/python/pyarrow/src/arrow/python/config_internal.h.cmake index e8a6e78c48..70d184a4f7 100644 --- a/python/pyarrow/src/arrow/python/config_internal.h.cmake +++ b/python/pyarrow/src/arrow/python/config_internal.h.cmake @@ -15,4 +15,6 @@ // specific language governing permissions and limitations // under the License. -#define PYARROW_BUILD_TYPE "@UPPERCASE_PYBUILD_TYPE@" \ No newline at end of file +#define PYARROW_BUILD_TYPE "@UPPERCASE_PYBUILD_TYPE@" + +#cmakedefine ARROW_MIMALLOC ``` ### Component(s) Python -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
