Update python garbage collector debugging tools (compatible with release mode).
@@ -600,6 +600,8 @@ int py_loader_impl_initialize_traceback(loader_impl impl, loader_impl_py py_impl
}
int py_loader_impl_initialize_gc(loader_impl_py py_impl)
+{
+ #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__))
{
PyObject * module_name = PyUnicode_DecodeFSDefault("gc");
@@ -644,6 +646,14 @@ int py_loader_impl_initialize_gc(loader_impl_py py_impl)
return 1;
}
+ #else
+ {
+ (void)py_impl;
+
+ return 1;
+ }
+ #endif
+}
loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration config, loader_host host)
{
@@ -1203,6 +1213,8 @@ void py_loader_impl_error_print(loader_impl_py py_impl)
}
void py_loader_impl_gc_print(loader_impl_py py_impl)
+{
+ #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__))
{
static const char garbage_format_str[] = "Python Garbage Collector:\n%s";
static const char separator_str[] = "\n";
@@ -1229,6 +1241,12 @@ void py_loader_impl_gc_print(loader_impl_py py_impl)
Py_DECREF(separator);
Py_DECREF(garbage_str_obj);
}
+ #else
+ {
+ (void)py_impl;
+ }
+ #endif
+}
int py_loader_impl_destroy(loader_impl impl)
{
