diff options
author | Josh Haberman <jhaberman@gmail.com> | 2014-08-09 03:43:32 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2014-08-09 03:43:32 -0700 |
commit | d869097400048af4b943e0679bab21b759facb80 (patch) | |
tree | 933247f287a427202dc98904419e7dd27e683574 /upb/refcounted.h | |
parent | cf2a959fa1fa48ca068dfecb6bee660b0a2ff395 (diff) |
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)
Diffstat (limited to 'upb/refcounted.h')
-rw-r--r-- | upb/refcounted.h | 11 |
1 files changed, 7 insertions, 4 deletions
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 |