Closed andrjohns closed 4 days ago
Does this silence the warning?
diff --git a/cutils.h b/cutils.h
index 26436d4..6d0c994 100644
--- a/cutils.h
+++ b/cutils.h
@@ -484,6 +484,8 @@ uint64_t js__hrtime_ns(void);
static inline size_t js__malloc_usable_size(const void *ptr)
{
+ if (!ptr)
+ return 0;
#if defined(__APPLE__)
return malloc_size(ptr);
#elif defined(_WIN32)
Unfortunately not. If you want to experiment with other approaches you can also see the warning in action here: https://godbolt.org/z/jq15nWz5d
Closes #453