summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2017-11-15 22:26:48 +0100
committerYves Orton <demerphq@gmail.com>2017-11-16 17:58:01 +0100
commitdbb571062f3e35020abd3df7d9439ad7a40cd560 (patch)
treeb34714cc26c667acc1c4580b8d4f269965b51974
parentc7be253fdfd98c3c7a091c34b43f3f16b4f9af0d (diff)
downloadperl-dbb571062f3e35020abd3df7d9439ad7a40cd560.tar.gz
handy.h: add a comment about perl_assert_ptr()
-rw-r--r--handy.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/handy.h b/handy.h
index 87c45471d1..e049192f39 100644
--- a/handy.h
+++ b/handy.h
@@ -2448,6 +2448,9 @@ void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumbe
#define Safefree(d) safefree(MEM_LOG_FREE((Malloc_t)(d)))
#endif
+/* assert that a valid ptr has been supplied - use this instead of assert(ptr) *
+ * as it handles cases like constant string arguments without throwing warnings *
+ * the cast is required, as is the inequality check, to avoid warnings */
#define perl_assert_ptr(p) assert( ((void*)(p)) != 0 )