From d869097400048af4b943e0679bab21b759facb80 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Sat, 9 Aug 2014 03:43:32 -0700 Subject: Make the absence of perf-cppflags give a good default build. Defaults are now: - thread-safe with GCC/Clang - Debugging not enabled (enable with -UNDEBUG) --- upb/refcounted.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'upb/refcounted.h') diff --git a/upb/refcounted.h b/upb/refcounted.h index 42251b1..3de4a12 100644 --- a/upb/refcounted.h +++ b/upb/refcounted.h @@ -21,10 +21,13 @@ #include "upb/table.int.h" -// Reference tracking is designed to be used with a tool like Valgrind; when -// enabled, it will cause reference leaks to show up as actual memory leaks -// that are attributed to the code that leaked the ref, *not* the code that -// originally created the object. +// Reference tracking will check ref()/unref() operations to make sure the +// ref ownership is correct. Where possible it will also make tools like +// Valgrind attribute ref leaks to the code that took the leaked ref, not +// the code that originally created the object. +// +// Enabling this requires the application to define upb_lock()/upb_unlock() +// functions that acquire/release a global mutex (or #define UPB_THREAD_UNSAFE). #ifndef NDEBUG #define UPB_DEBUG_REFS #endif -- cgit v1.2.3