From b4a2f4ed60bea93ee95df7dea8cd611ba3515b99 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 14 Nov 2019 13:34:21 -0800 Subject: [PATCH] Fix debug/release conditional compilation flags for free() --- lib/binding_rust/util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/binding_rust/util.rs b/lib/binding_rust/util.rs index 3480c02d..1a4ac1b7 100644 --- a/lib/binding_rust/util.rs +++ b/lib/binding_rust/util.rs @@ -4,7 +4,7 @@ extern "C" { /// In *Release* builds, the C library links directly against `malloc` and `free`. /// /// When freeing memory that was allocated by C code, use `free` directly. - #[cfg(not(test))] + #[cfg(not(debug_assertions))] #[link_name = "free"] pub fn free_ptr(ptr: *mut c_void); @@ -15,7 +15,7 @@ extern "C" { /// /// When freeing memory that was allocated by C code, use the `free` function /// from that module. - #[cfg(test)] + #[cfg(debug_assertions)] #[link_name = "ts_record_free"] pub fn free_ptr(ptr: *mut c_void);