From cb4c04d2781f6249e7c5fb2a47c79b07c1469294 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Fri, 8 Nov 2024 00:42:26 +0800 Subject: [PATCH] fix: decrease max depth for debug build on Windows --- include/optree/treespec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/optree/treespec.h b/include/optree/treespec.h index 23d23b07..ef10adbc 100644 --- a/include/optree/treespec.h +++ b/include/optree/treespec.h @@ -44,7 +44,7 @@ using ssize_t = py::ssize_t; #ifndef Py_C_RECURSION_LIMIT #define Py_C_RECURSION_LIMIT 1000 #endif -#ifndef PYPY_VERSION +#if !defined(PYPY_VERSION) && !(defined(MS_WINDOWS) && defined(Py_DEBUG)) constexpr ssize_t MAX_RECURSION_DEPTH = std::min(1000, Py_C_RECURSION_LIMIT); #else constexpr ssize_t MAX_RECURSION_DEPTH = std::min(500, Py_C_RECURSION_LIMIT);