-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fails on non-Linux systems: error: variable has incomplete type 'struct mallinfo' #409
Comments
BSD might require |
No, As an alternative, you can use Google's tcmalloc from the google-perftools package. |
Is this malloc documentation available on your FreeBSD? It should also be possible (albeit a pain) to extract memory information from the I created #411. Can you see if it fixes the first warning? |
I don't have a BSD system of my own and won't be able to spin up a VM for a few weeks. Since diff --git a/pcu/pcu_mem.c b/pcu/pcu_mem.c
index 8ac2345c..5532ffac 100644
--- a/pcu/pcu_mem.c
+++ b/pcu/pcu_mem.c
@@ -8,6 +8,7 @@
*******************************************************************************/
#include <PCU.h>
+#include "reel.h" // reel_fail
#if defined(__APPLE__)
@@ -54,5 +55,7 @@ double PCU_GetMem() {
#elif defined(__GNUC__)
struct mallinfo meminfo_now = mallinfo();
return ((double)meminfo_now.arena)/M;
+#else
+ reel_fail("mallinfo not supported.");
#endif
} Or, if you want those tests to run more or less successfully: diff --git a/pcu/pcu_mem.c b/pcu/pcu_mem.c
index 8ac2345c..889650fb 100644
--- a/pcu/pcu_mem.c
+++ b/pcu/pcu_mem.c
@@ -54,5 +54,7 @@ double PCU_GetMem() {
#elif defined(__GNUC__)
struct mallinfo meminfo_now = mallinfo();
return ((double)meminfo_now.arena)/M;
+#else
+ return 0.0;
#endif
} In any case, I'm sure there are other systems where mallinfo isn't available, so there ought to be a solution. |
Errors/warnings:
mallinfo is a linux-specific function.
Version: 2.2.8
clang-16
FreeBSD 14.0 STABLE
The text was updated successfully, but these errors were encountered: