#elif HAVE_SYSCTL
pagesize = getpagesize ();
+ if (pagesize <= 0)
+ {
+ ERROR ("memory plugin: Invalid pagesize: %i", pagesize);
+ return (-1);
+ }
/* #endif HAVE_SYSCTL */
#elif HAVE_SYSCTLBYNAME
struct vmtotal vmtotal;
size_t size;
- if (pagesize <= 0)
- {
- ERROR ("memory plugin: Invalid pagesize: %i", pagesize);
- return (-1);
- }
-
memset (&vmtotal, 0, sizeof (vmtotal));
size = sizeof (vmtotal);
return (-1);
}
+ assert (pagesize > 0);
memory_submit ("active", vmtotal.t_arm * pagesize);
memory_submit ("inactive", (vmtotal.t_rm - vmtotal.t_arm) * pagesize);
memory_submit ("free", vmtotal.t_free * pagesize);