summaryrefslogtreecommitdiff
path: root/upb/refcounted.h
diff options
context:
space:
mode:
Diffstat (limited to 'upb/refcounted.h')
-rw-r--r--upb/refcounted.h11
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback